Skip to content

Commit

Permalink
io_uring: don't punt files update to io-wq unconditionally
Browse files Browse the repository at this point in the history
[ Upstream commit cdb31c2 ]

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 <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
axboe authored and gregkh committed Sep 30, 2021
1 parent 05ac8e4 commit 2f6caa5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fs/io_uring.c
Expand Up @@ -5919,19 +5919,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);
Expand Down

0 comments on commit 2f6caa5

Please sign in to comment.