From: Karel Zak <kzak@redhat.com>
To: Jan Kara <jack@suse.cz>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
util-linux@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: Racy loop device reuse logic
Date: Thu, 20 Jan 2022 09:50:09 +0100 [thread overview]
Message-ID: <20220120085009.xecitkc7f2digut6@ws.net.home> (raw)
In-Reply-To: <20220119213415.csieaktdqmshemiy@quack3.lan>
On Wed, Jan 19, 2022 at 10:34:15PM +0100, Jan Kara wrote:
> On Wed 19-01-22 20:30:52, Tetsuo Handa wrote:
> > I found a way to avoid this race by splitting lo_open() into two phases
> > using task_work_add(). Christoph Hellwig is trying to take a look at
> > https://lkml.kernel.org/r/f6b947d0-1047-66b3-0243-af5017c9ab55@I-love.SAKURA.ne.jp
> > .
>
> No, you have found a way to make the race window for mount(8) smaller. And
> I still disagree with that kernel change because it is making kernel more
> complex only to make the race window smaller. On another machine or with
> different scheduling decisions, you can still hit this race. This problem
> must be fixed in mount...
+1
I think Jan is right. In this case mount(8) is not robust enough. It
reads info about the device from /sys and then it opens the device.
Unfortunately, whatever can happen before the open() call.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
next prev parent reply other threads:[~2022-01-20 8:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-13 15:47 Racy loop device reuse logic Jan Kara
2022-01-19 8:52 ` Jan Kara
2022-01-19 11:30 ` Tetsuo Handa
2022-01-19 21:34 ` Jan Kara
2022-01-20 8:50 ` Karel Zak [this message]
2022-01-20 10:09 ` Tetsuo Handa
2022-01-19 11:39 ` Karel Zak
2022-01-19 21:34 ` Jan Kara
2022-01-20 12:13 ` Jan Kara
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=20220120085009.xecitkc7f2digut6@ws.net.home \
--to=kzak@redhat.com \
--cc=jack@suse.cz \
--cc=linux-block@vger.kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=util-linux@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