summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorHao Xu <haoxu@linux.alibaba.com>2021-10-14 22:04:00 +0800
committerJens Axboe <axboe@kernel.dk>2021-10-14 09:06:11 -0600
commit14cfbb7a7856f190035f8e53045bdbfa648fae41 (patch)
tree7930f223e94c3206b1c4115334184ed06a3813c0 /fs
parent3f008385d46d3cea4a097d2615cd485f2184ba26 (diff)
downloadlwn-14cfbb7a7856f190035f8e53045bdbfa648fae41.tar.gz
lwn-14cfbb7a7856f190035f8e53045bdbfa648fae41.zip
io_uring: fix wrong condition to grab uring lock
Grab uring lock when we are in io-worker rather than in the original or system-wq context since we already hold it in these two situation. Signed-off-by: Hao Xu <haoxu@linux.alibaba.com> Fixes: b66ceaf324b3 ("io_uring: move iopoll reissue into regular IO path") Link: https://lore.kernel.org/r/20211014140400.50235-1-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-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 6b9e70208782..e68d27829bb2 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2949,7 +2949,7 @@ static void kiocb_done(struct kiocb *kiocb, ssize_t ret,
struct io_ring_ctx *ctx = req->ctx;
req_set_fail(req);
- if (issue_flags & IO_URING_F_NONBLOCK) {
+ if (!(issue_flags & IO_URING_F_NONBLOCK)) {
mutex_lock(&ctx->uring_lock);
__io_req_complete(req, issue_flags, ret, cflags);
mutex_unlock(&ctx->uring_lock);