All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Pavel Begunkov <asml.silence@gmail.com>, io-uring@vger.kernel.org
Subject: Re: [PATCH 1/1] io_uring: fix exiting io_req_task_work_add leaks
Date: Thu, 1 Jul 2021 13:41:12 -0600	[thread overview]
Message-ID: <c92b117a-5bbf-27ba-e930-74e17776003a@kernel.dk> (raw)
In-Reply-To: <060002f19f1fdbd130ba24aef818ea4d3080819b.1625142209.git.asml.silence@gmail.com>

On 7/1/21 6:26 AM, Pavel Begunkov wrote:
> If one entered io_req_task_work_add() not seeing PF_EXITING, it will set
> a ->task_state bit and try task_work_add(), which may fail by that
> moment. If that happens the function would try to cancel the request.
> 
> However, in a meanwhile there might come other io_req_task_work_add()
> callers, which will see the bit set and leave their requests in the
> list, which will never be executed.
> 
> Don't propagate an error, but clear the bit first and then fallback
> all requests that we can splice from the list. The callback functions
> have to be able to deal with PF_EXITING, so poll and apoll was modified
> via changing io_poll_rewait().

I applied this one, adding a fixes tag too. Thanks!

-- 
Jens Axboe


      parent reply	other threads:[~2021-07-01 19:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 12:26 [PATCH 1/1] io_uring: fix exiting io_req_task_work_add leaks Pavel Begunkov
2021-07-01 13:45 ` Jens Axboe
2021-07-01 14:19   ` Pavel Begunkov
2021-07-01 14:56     ` Jens Axboe
2021-07-01 14:34   ` Pavel Begunkov
2021-07-01 19:41 ` Jens Axboe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c92b117a-5bbf-27ba-e930-74e17776003a@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=asml.silence@gmail.com \
    --cc=io-uring@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.