summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-04-15 22:08:20 +0100
committerJens Axboe <axboe@kernel.dk>2022-04-24 18:02:49 -0600
commitf22190570b213dcc84216ac07cfd0eeada010013 (patch)
tree76a95212cabcd9d919f7f972dfe80eee70d6b695
parentd8da428b7a9a71bc2ee6bf628a8c0f9beb96a195 (diff)
downloadlwn-f22190570b213dcc84216ac07cfd0eeada010013.tar.gz
lwn-f22190570b213dcc84216ac07cfd0eeada010013.zip
io_uring: clean poll tw PF_EXITING handling
When we meet PF_EXITING in io_poll_check_events(), don't overcomplicate the code with io_poll_mark_cancelled() but just return -ECANCELED and the callers will deal with the rest. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/f0cc981af82a5b193658f8f44397eeb3bf838b7b.1650056133.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--fs/io_uring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index fc47f8fdae7c..76d51c6e3ab9 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -5902,7 +5902,7 @@ static int io_poll_check_events(struct io_kiocb *req, bool locked)
/* req->task == current here, checking PF_EXITING is safe */
if (unlikely(req->task->flags & PF_EXITING))
- io_poll_mark_cancelled(req);
+ return -ECANCELED;
do {
v = atomic_read(&req->poll_refs);