Skip to content

Commit cdb31c2

Browse files
committed
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: 05f3fb3 ("io_uring: avoid ring quiesce for fixed file set unregister and update") Signed-off-by: Jens Axboe <[email protected]>
1 parent 9990da9 commit cdb31c2

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

fs/io_uring.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6340,19 +6340,16 @@ static int io_files_update(struct io_kiocb *req, unsigned int issue_flags)
63406340
struct io_uring_rsrc_update2 up;
63416341
int ret;
63426342

6343-
if (issue_flags & IO_URING_F_NONBLOCK)
6344-
return -EAGAIN;
6345-
63466343
up.offset = req->rsrc_update.offset;
63476344
up.data = req->rsrc_update.arg;
63486345
up.nr = 0;
63496346
up.tags = 0;
63506347
up.resv = 0;
63516348

6352-
mutex_lock(&ctx->uring_lock);
6349+
io_ring_submit_lock(ctx, !(issue_flags & IO_URING_F_NONBLOCK));
63536350
ret = __io_register_rsrc_update(ctx, IORING_RSRC_FILE,
63546351
&up, req->rsrc_update.nr_args);
6355-
mutex_unlock(&ctx->uring_lock);
6352+
io_ring_submit_unlock(ctx, !(issue_flags & IO_URING_F_NONBLOCK));
63566353

63576354
if (ret < 0)
63586355
req_set_fail(req);

0 commit comments

Comments
 (0)