summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-09-24 17:43:54 +0300
committerJens Axboe <axboe@kernel.dk>2021-09-24 19:24:34 +0300
commitcdb31c29d397a8076d81fd1458d091c647ef94ba (patch)
tree8e10100e9f1e1fbabb114cccb705ab60ceb07952 /fs
parent9990da93d2bf9892c2c14c958bef050d4e461a1a (diff)
downloadlinux-cdb31c29d397a8076d81fd1458d091c647ef94ba.tar.xz
io_uring: don't punt files update to io-wq unconditionally
There's no reason to punt it unconditionally, we just need to ensure that the submit lock grabbing is conditional. Fixes: 05f3fb3c5397 ("io_uring: avoid ring quiesce for fixed file set unregister and update") Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r--fs/io_uring.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 01e49d01fe74..c6139ace11fa 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -6340,19 +6340,16 @@ static int io_files_update(struct io_kiocb *req, unsigned int issue_flags)
struct io_uring_rsrc_update2 up;
int ret;
- if (issue_flags & IO_URING_F_NONBLOCK)
- return -EAGAIN;
-
up.offset = req->rsrc_update.offset;
up.data = req->rsrc_update.arg;
up.nr = 0;
up.tags = 0;
up.resv = 0;
- mutex_lock(&ctx->uring_lock);
+ io_ring_submit_lock(ctx, !(issue_flags & IO_URING_F_NONBLOCK));
ret = __io_register_rsrc_update(ctx, IORING_RSRC_FILE,
&up, req->rsrc_update.nr_args);
- mutex_unlock(&ctx->uring_lock);
+ io_ring_submit_unlock(ctx, !(issue_flags & IO_URING_F_NONBLOCK));
if (ret < 0)
req_set_fail(req);