Commit 692495ba authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'io_uring-5.9-2020-09-25' of git://git.kernel.dk/linux-block

Pull io_uring fixes from Jens Axboe:
 "Two fixes for regressions in this cycle, and one that goes to 5.8
  stable:

   - fix leak of getname() retrieved filename

   - remove plug->nowait assignment, fixing a regression with btrfs

   - fix for async buffered retry"

* tag 'io_uring-5.9-2020-09-25' of git://git.kernel.dk/linux-block:
  io_uring: ensure async buffered read-retry is setup properly
  io_uring: don't unconditionally set plug->nowait = true
  io_uring: ensure open/openat2 name is cleaned on cancelation
parents 9d2fbaef f38c7e3a
...@@ -3172,10 +3172,8 @@ static int io_read(struct io_kiocb *req, bool force_nonblock, ...@@ -3172,10 +3172,8 @@ static int io_read(struct io_kiocb *req, bool force_nonblock,
goto done; goto done;
/* some cases will consume bytes even on error returns */ /* some cases will consume bytes even on error returns */
iov_iter_revert(iter, iov_count - iov_iter_count(iter)); iov_iter_revert(iter, iov_count - iov_iter_count(iter));
ret = io_setup_async_rw(req, iovec, inline_vecs, iter, false); ret = 0;
if (ret) goto copy_iov;
goto out_free;
return -EAGAIN;
} else if (ret < 0) { } else if (ret < 0) {
/* make sure -ERESTARTSYS -> -EINTR is done */ /* make sure -ERESTARTSYS -> -EINTR is done */
goto done; goto done;
...@@ -5671,6 +5669,11 @@ static void __io_clean_op(struct io_kiocb *req) ...@@ -5671,6 +5669,11 @@ static void __io_clean_op(struct io_kiocb *req)
io_put_file(req, req->splice.file_in, io_put_file(req, req->splice.file_in,
(req->splice.flags & SPLICE_F_FD_IN_FIXED)); (req->splice.flags & SPLICE_F_FD_IN_FIXED));
break; break;
case IORING_OP_OPENAT:
case IORING_OP_OPENAT2:
if (req->open.filename)
putname(req->open.filename);
break;
} }
req->flags &= ~REQ_F_NEED_CLEANUP; req->flags &= ~REQ_F_NEED_CLEANUP;
} }
...@@ -6348,9 +6351,6 @@ static void io_submit_state_start(struct io_submit_state *state, ...@@ -6348,9 +6351,6 @@ static void io_submit_state_start(struct io_submit_state *state,
struct io_ring_ctx *ctx, unsigned int max_ios) struct io_ring_ctx *ctx, unsigned int max_ios)
{ {
blk_start_plug(&state->plug); blk_start_plug(&state->plug);
#ifdef CONFIG_BLOCK
state->plug.nowait = true;
#endif
state->comp.nr = 0; state->comp.nr = 0;
INIT_LIST_HEAD(&state->comp.list); INIT_LIST_HEAD(&state->comp.list);
state->comp.ctx = ctx; state->comp.ctx = ctx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment