From: Bart Van Assche <bvanassche@acm.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
Andrew Morton <akpm@linux-foundation.org>,
Brian Foster <bfoster@redhat.com>,
Damien Le Moal <dlemoal@kernel.org>,
Hillf Danton <hdanton@sina.com>,
Markus Elfring <Markus.Elfring@web.de>,
Ming Lei <tom.leiming@gmail.com>, Qu Wenruo <wqu@suse.com>,
Tao Cui <cui.tao@linux.dev>, kernel test robot <lkp@intel.com>,
linux-block <linux-block@vger.kernel.org>,
rust-for-linux@vger.kernel.org
Subject: Re: [PATCH 2/2] loop: Perform __loop_clr_fd() after disk->open_mutex is dropped.
Date: Fri, 11 Sep 2026 18:02:18 -0700 [thread overview]
Message-ID: <b700652d-ed63-444a-b879-ec2725affaa7@acm.org> (raw)
In-Reply-To: <15037162-0e54-4722-ac7e-c9a863a8a2f7@I-love.SAKURA.ne.jp>
On 9/11/26 3:18 PM, Tetsuo Handa wrote:
> On 2026/09/12 5:03, Bart Van Assche wrote:
>> On 9/10/26 2:44 AM, Tetsuo Handa wrote:
>>> On 2026/09/10 4:33, Bart Van Assche wrote:
>>>> __loop_clr_fd() is queued from the lo_post_release() callback and hence
>>>> may be called concurrently with or after another thread has called
>>>> bdev_open(). Hence, lo->lo->state should be checked instead of assuming
>>>> that it equals Lo_rundown.
>>>
>>> No, __loop_clr_fd() is queued from the lo_release() callback.
>>
>> Yes, it is *queued* from the lo_release() callback function but there is
>> no guarantee that __loop_clr_fd() has started before bdev_open() is
>> called again.
>
> Since lo->lo_state was set to Lo_rundown by lo_release(), lo_open() will return -ENXIO.
> What can go wrong if bdev_open() is called again before __loop_clr_fd() starts?
This breaks LO_FLAGS_AUTOCLEAR, isn't it?
Thanks,
Bart.
next prev parent reply other threads:[~2026-09-12 1:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 10:48 [PATCH 1/2] block: Add post_release() operation Tetsuo Handa
2026-09-09 10:49 ` [PATCH 2/2] loop: Perform __loop_clr_fd() after disk->open_mutex is dropped Tetsuo Handa
2026-09-09 19:33 ` Bart Van Assche
2026-09-10 9:44 ` Tetsuo Handa
2026-09-11 20:03 ` Bart Van Assche
2026-09-11 22:18 ` Tetsuo Handa
2026-09-12 1:02 ` Bart Van Assche [this message]
2026-09-12 1:22 ` Tetsuo Handa
2026-09-10 11:53 ` [PATCH 1/2] block: Add post_release() operation Gary Guo
2026-09-10 12:14 ` Tetsuo Handa
2026-09-11 19:54 ` Bart Van Assche
2026-09-11 22:34 ` Tetsuo Handa
2026-09-12 0:31 ` Bart Van Assche
2026-09-12 1:43 ` Tetsuo Handa
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=b700652d-ed63-444a-b879-ec2725affaa7@acm.org \
--to=bvanassche@acm.org \
--cc=Markus.Elfring@web.de \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=bfoster@redhat.com \
--cc=cui.tao@linux.dev \
--cc=dlemoal@kernel.org \
--cc=hch@lst.de \
--cc=hdanton@sina.com \
--cc=linux-block@vger.kernel.org \
--cc=lkp@intel.com \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=rust-for-linux@vger.kernel.org \
--cc=tom.leiming@gmail.com \
--cc=viro@zeniv.linux.org.uk \
--cc=wqu@suse.com \
/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).