summaryrefslogtreecommitdiffstats
path: root/io_uring/kbuf.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-11-23 12:33:41 +0100
committerJens Axboe <axboe@kernel.dk>2022-11-23 18:45:31 +0100
commit1bec951c3809051f64a6957fe86d1b4786cc0313 (patch)
tree7964364c1c55aea528254617dc80a3c6e6fd14ad /io_uring/kbuf.c
parentio_uring: inline __io_req_complete_put() (diff)
downloadlinux-1bec951c3809051f64a6957fe86d1b4786cc0313.tar.xz
linux-1bec951c3809051f64a6957fe86d1b4786cc0313.zip
io_uring: iopoll protect complete_post
io_req_complete_post() may be used by iopoll enabled rings, grab locks in this case. That requires to pass issue_flags to propagate the locking state. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/cc6d854065c57c838ca8e8806f707a226b70fd2d.1669203009.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/kbuf.c')
-rw-r--r--io_uring/kbuf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c
index e2c46889d5fa..e8150ed637d8 100644
--- a/io_uring/kbuf.c
+++ b/io_uring/kbuf.c
@@ -311,7 +311,7 @@ int io_remove_buffers(struct io_kiocb *req, unsigned int issue_flags)
/* complete before unlock, IOPOLL may need the lock */
io_req_set_res(req, ret, 0);
- __io_req_complete(req, issue_flags);
+ io_req_complete_post(req, 0);
io_ring_submit_unlock(ctx, issue_flags);
return IOU_ISSUE_SKIP_COMPLETE;
}
@@ -462,7 +462,7 @@ err:
req_set_fail(req);
/* complete before unlock, IOPOLL may need the lock */
io_req_set_res(req, ret, 0);
- __io_req_complete(req, issue_flags);
+ io_req_complete_post(req, 0);
io_ring_submit_unlock(ctx, issue_flags);
return IOU_ISSUE_SKIP_COMPLETE;
}