io_uring: don't check iopoll if request completes
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 1 Dec 2023 00:38:52 +0000 (00:38 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:45 +0000 (15:35 -0800)
commit2c487fbf22303cf6f21e59659bccc0ce0ff0ca41
treeda3cd0d05d9020f6d9b4afcc6fd24452650ca498
parentd15de929f066a79eb9f85814c0ffa27232e0418f
io_uring: don't check iopoll if request completes

commit 9b43ef3d52532a0175ed6654618f7db61d390d2e upstream.

IOPOLL request should never return IOU_OK, so the following iopoll
queueing check in io_issue_sqe() after getting IOU_OK doesn't make any
sense as would never turn true. Let's optimise on that and return a bit
earlier. It's also much more resilient to potential bugs from
mischieving iopoll implementations.

Cc: <stable@vger.kernel.org>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/2f8690e2fa5213a2ff292fac29a7143c036cdd60.1701390926.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/io_uring.c