1. 05 Jul, 2020 4 commits
    • Pavel Begunkov's avatar
      io_uring: fix mis-refcounting linked timeouts · 6df1db6b
      Pavel Begunkov authored
      io_prep_linked_timeout() sets REQ_F_LINK_TIMEOUT altering refcounting of
      the following linked request. After that someone should call
      io_queue_linked_timeout(), otherwise a submission reference of the linked
      timeout won't be ever dropped.
      
      That's what happens in io_steal_work() if io-wq decides to postpone linked
      request with io_wqe_enqueue(). io_queue_linked_timeout() can also be
      potentially called twice without synchronisation during re-submission,
      e.g. io_rw_resubmit().
      
      There are the rules, whoever did io_prep_linked_timeout() must also call
      io_queue_linked_timeout(). To not do it twice, io_prep_linked_timeout()
      will return non NULL only for the first call. That's controlled by
      REQ_F_LINK_TIMEOUT flag.
      
      Also kill REQ_F_QUEUE_TIMEOUT.
      Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      6df1db6b
    • Jens Axboe's avatar
      io_uring: use new io_req_task_work_add() helper throughout · c2c4c83c
      Jens Axboe authored
      Since we now have that in the 5.9 branch, convert the existing users of
      task_work_add() to use this new helper.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      c2c4c83c
    • Jens Axboe's avatar
      io_uring: abstract out task work running · 4c6e277c
      Jens Axboe authored
      Provide a helper to run task_work instead of checking and running
      manually in a bunch of different spots. While doing so, also move the
      task run state setting where we run the task work. Then we can move it
      out of the callback helpers. This also helps ensure we only do this once
      per task_work list run, not per task_work item.
      Suggested-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      4c6e277c
    • Jens Axboe's avatar
      Merge branch 'io_uring-5.8' into for-5.9/io_uring · 58c6a581
      Jens Axboe authored
      Pull in task_work changes from the 5.8 series, as we'll need to apply
      the same kind of changes to other parts in the 5.9 branch.
      
      * io_uring-5.8:
        io_uring: fix regression with always ignoring signals in io_cqring_wait()
        io_uring: use signal based task_work running
        task_work: teach task_work_add() to do signal_wake_up()
      58c6a581
  2. 04 Jul, 2020 1 commit
    • Jens Axboe's avatar
      io_uring: fix regression with always ignoring signals in io_cqring_wait() · b7db41c9
      Jens Axboe authored
      When switching to TWA_SIGNAL for task_work notifications, we also made
      any signal based condition in io_cqring_wait() return -ERESTARTSYS.
      This breaks applications that rely on using signals to abort someone
      waiting for events.
      
      Check if we have a signal pending because of queued task_work, and
      repeat the signal check once we've run the task_work. This provides a
      reliable way of telling the two apart.
      
      Additionally, only use TWA_SIGNAL if we are using an eventfd. If not,
      we don't have the dependency situation described in the original commit,
      and we can get by with just using TWA_RESUME like we previously did.
      
      Fixes: ce593a6c ("io_uring: use signal based task_work running")
      Cc: stable@vger.kernel.org # v5.7
      Reported-by: default avatarAndres Freund <andres@anarazel.de>
      Tested-by: default avatarAndres Freund <andres@anarazel.de>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      b7db41c9
  3. 30 Jun, 2020 17 commits
  4. 29 Jun, 2020 1 commit
  5. 28 Jun, 2020 14 commits
  6. 27 Jun, 2020 1 commit
    • Randy Dunlap's avatar
      io_uring: fix function args for !CONFIG_NET · 1e16c2f9
      Randy Dunlap authored
      Fix build errors when CONFIG_NET is not set/enabled:
      
      ../fs/io_uring.c:5472:10: error: too many arguments to function ‘io_sendmsg’
      ../fs/io_uring.c:5474:10: error: too many arguments to function ‘io_send’
      ../fs/io_uring.c:5484:10: error: too many arguments to function ‘io_recvmsg’
      ../fs/io_uring.c:5486:10: error: too many arguments to function ‘io_recv’
      ../fs/io_uring.c:5510:9: error: too many arguments to function ‘io_accept’
      ../fs/io_uring.c:5518:9: error: too many arguments to function ‘io_connect’
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: io-uring@vger.kernel.org
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      1e16c2f9
  7. 26 Jun, 2020 2 commits