]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: only assign io_uring_enter() SQPOLL error in actual error case
authorJens Axboe <axboe@kernel.dk>
Sat, 14 Aug 2021 15:04:40 +0000 (09:04 -0600)
committerJens Axboe <axboe@kernel.dk>
Sat, 14 Aug 2021 18:38:21 +0000 (12:38 -0600)
commite39e33e6cb110e8900d7dc320f5e5d280a7b19ff
treef680b17ee19d8069fafac58f8bcfca3aa4782e75
parent7d31cc846425a656b459b43a037f60fabba40d8e
io_uring: only assign io_uring_enter() SQPOLL error in actual error case

If an SQPOLL based ring is newly created and an application issues an
io_uring_enter(2) system call on it, then we can return a spurious
-EOWNERDEAD error. This happens because there's nothing to submit, and
if the caller doesn't specify any other action, the initial error
assignment of -EOWNERDEAD never gets overwritten. This causes us to
return it directly, even if it isn't valid.

Move the error assignment into the actual failure case instead.

Cc: stable@vger.kernel.org
Fixes: 2e3269c402ff ("io_uring: stop SQPOLL submit on creator's death")
Reported-by: Sherlock Holo sherlockya@gmail.com
Link: https://github.com/axboe/liburing/issues/413
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c