diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2021-02-07 01:37:24 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-02-07 01:37:24 +0300 |
commit | 860b45dae969966a52b4dd0470d8fca8479e4e4b (patch) | |
tree | a17eb88a938e107820812c65b92e30b27da0ac31 | |
parent | 1e0d27fce010b0a4a9e595506b6ede75934c31be (diff) | |
parent | aec18a57edad562d620f7d19016de1fc0cc2208c (diff) | |
download | linux-860b45dae969966a52b4dd0470d8fca8479e4e4b.tar.xz |
Merge tag 'io_uring-5.11-2021-02-05' of git://git.kernel.dk/linux-block
Pull io_uring fixes from Jens Axboe:
"Two small fixes that should go into 5.11:
- task_work resource drop fix (Pavel)
- identity COW fix (Xiaoguang)"
* tag 'io_uring-5.11-2021-02-05' of git://git.kernel.dk/linux-block:
io_uring: drop mm/files between task_work_submit
io_uring: don't modify identity's files uncess identity is cowed
-rw-r--r-- | fs/io_uring.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 38c6cbe1ab38..1f68105a41ed 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2205,6 +2205,9 @@ static void __io_req_task_submit(struct io_kiocb *req) else __io_req_task_cancel(req, -EFAULT); mutex_unlock(&ctx->uring_lock); + + if (ctx->flags & IORING_SETUP_SQPOLL) + io_sq_thread_drop_mm_files(); } static void io_req_task_submit(struct callback_head *cb) @@ -8982,12 +8985,6 @@ static void io_uring_cancel_task_requests(struct io_ring_ctx *ctx, if ((ctx->flags & IORING_SETUP_SQPOLL) && ctx->sq_data) { atomic_dec(&task->io_uring->in_idle); - /* - * If the files that are going away are the ones in the thread - * identity, clear them out. - */ - if (task->io_uring->identity->files == files) - task->io_uring->identity->files = NULL; io_sq_thread_unpark(ctx->sq_data); } } |