io_uring: fix wrong condition to grab uring lock
PATCH 1/1 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 <[email protected]>
--- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/io_uring.c +1 -1
@@ -2890,7 +2890,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);
Signature · 1 line
2.24.4
Quoted 3 lines · Hao Xu
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.
Fixes b66ceaf324b3 ("io_uring: move iopoll reissue into regular IO path")
Quoted 19 lines
Signed-off-by Hao Xu <[email protected]>--- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/io_uring.c +1
-1@@ -2890,7 +2890,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);
Quoted 2 lines · Hao Xu
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.
Good catch, lgtm
Quoted 19 lines
Signed-off-by Hao Xu <[email protected]>--- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/io_uring.c +1
-1@@ -2890,7 +2890,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);
Signature · 1 line
Pavel Begunkov
Quoted 4 lines · Hao Xu
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.
Applied, thanks!
[1/1] io_uring: fix wrong condition to grab uring lock
commit: 14cfbb7a7856f190035f8e53045bdbfa648fae41
Best regards,
Signature · 1 line
Jens Axboe