io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Pavel Begunkov <asml.silence@gmail.com>,
	io-uring@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] io_uring: fix async close()
Date: Sat, 8 Feb 2020 12:03:19 -0700	[thread overview]
Message-ID: <36dfed78-3399-38f6-7c9c-807803dec72a@kernel.dk> (raw)
In-Reply-To: <6ab2ba6d202439323571ab6536025df0dd8b167e.1581159868.git.asml.silence@gmail.com>

On 2/8/20 4:04 AM, Pavel Begunkov wrote:
> First, io_close() misses filp_close() and io_cqring_add_event(), when
> f_op->flush is defined. That's because in this case it will
> io_queue_async_work() itself not grabbing files, so the corresponding
> chunk in io_close_finish() won't be executed.
> 
> Second, when submitted through io_wq_submit_work(), it will do
> filp_close() and *_add_event() twice: first inline in io_close(),
> and the second one in call to io_close_finish() from io_close().
> The second one will also fire, because it was submitted async through
> generic path, and so have grabbed files.
> 
> And the last nice thing is to remove this weird pilgrimage with checking
> work/old_work and casting it to nxt. Just use a helper instead.

Thanks, applied. Nice cleanup, too!

-- 
Jens Axboe


      reply	other threads:[~2020-02-08 19:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-08 11:04 [PATCH 1/1] io_uring: fix async close() Pavel Begunkov
2020-02-08 19:03 ` 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=36dfed78-3399-38f6-7c9c-807803dec72a@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=asml.silence@gmail.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).