Merge branch 'for-5.19/io_uring' into for-5.19/io_uring-passthrough
authorJens Axboe <axboe@kernel.dk>
Mon, 9 May 2022 12:34:52 +0000 (06:34 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 May 2022 12:35:11 +0000 (06:35 -0600)
* for-5.19/io_uring: (85 commits)
  io_uring: don't clear req->kbuf when buffer selection is done
  io_uring: eliminate the need to track provided buffer ID separately
  io_uring: move provided buffer state closer to submit state
  io_uring: move provided and fixed buffers into the same io_kiocb area
  io_uring: abstract out provided buffer list selection
  io_uring: never call io_buffer_select() for a buffer re-select
  io_uring: get rid of hashed provided buffer groups
  io_uring: always use req->buf_index for the provided buffer group
  io_uring: ignore ->buf_index if REQ_F_BUFFER_SELECT isn't set
  io_uring: kill io_rw_buffer_select() wrapper
  io_uring: make io_buffer_select() return the user address directly
  io_uring: kill io_recv_buffer_select() wrapper
  io_uring: use 'sr' vs 'req->sr_msg' consistently
  io_uring: add POLL_FIRST support for send/sendmsg and recv/recvmsg
  io_uring: check IOPOLL/ioprio support upfront
  io_uring: replace smp_mb() with smp_mb__after_atomic() in io_sq_thread()
  io_uring: add IORING_SETUP_TASKRUN_FLAG
  io_uring: use TWA_SIGNAL_NO_IPI if IORING_SETUP_COOP_TASKRUN is used
  io_uring: set task_work notify method at init time
  io-wq: use __set_notify_signal() to wake workers
  ...

1  2 
fs/io_uring.c

diff --cc fs/io_uring.c
@@@ -5206,10 -5298,8 +5299,10 @@@ static int io_sendmsg_prep(struct io_ki
  {
        struct io_sr_msg *sr = &req->sr_msg;
  
-       if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL))
+       if (unlikely(sqe->file_index))
                return -EINVAL;
 +      if (unlikely(sqe->addr2 || sqe->file_index))
 +              return -EINVAL;
  
        sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr));
        sr->len = READ_ONCE(sqe->len);
@@@ -5419,10 -5534,8 +5537,10 @@@ static int io_recvmsg_prep(struct io_ki
  {
        struct io_sr_msg *sr = &req->sr_msg;
  
-       if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL))
+       if (unlikely(sqe->file_index))
                return -EINVAL;
 +      if (unlikely(sqe->addr2 || sqe->file_index))
 +              return -EINVAL;
  
        sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr));
        sr->len = READ_ONCE(sqe->len);
@@@ -6947,12 -7151,7 +7156,12 @@@ static int io_req_prep(struct io_kiocb 
  
  static int io_req_prep_async(struct io_kiocb *req)
  {
 -      if (!io_op_defs[req->opcode].needs_async_setup)
 +      const struct io_op_def *def = &io_op_defs[req->opcode];
 +
 +      /* assign early for deferred execution for non-fixed file */
 +      if (def->needs_file && !(req->flags & REQ_F_FIXED_FILE))
-               req->file = io_file_get_normal(req, req->fd);
++              req->file = io_file_get_normal(req, req->cqe.fd);
 +      if (!def->needs_async_setup)
                return 0;
        if (WARN_ON_ONCE(req_has_async_data(req)))
                return -EFAULT;