From: Boris Burkov <boris@bur.io>
To: Christoph Hellwig <hch@infradead.org>
Cc: Anand Jain <anand.jain@oracle.com>,
dsterba@suse.com, linux-btrfs@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: validate device maj:min during open
Date: Fri, 8 Mar 2024 09:51:33 -0800 [thread overview]
Message-ID: <20240308175133.GA2470614@zen.localdomain> (raw)
In-Reply-To: <ZetOIKNJRsdFNJ3A@infradead.org>
On Fri, Mar 08, 2024 at 09:42:56AM -0800, Christoph Hellwig wrote:
> On Fri, Mar 08, 2024 at 09:32:54AM -0800, Boris Burkov wrote:
> > You remove/add the device in a way that results in a new bd_dev while
> > the filesystem is unmounted but btrfs is still caching the struct
> > btrfs_device. When we unmount a multi-device fs, we don't clear the
> > device cache, since we need it to remount with just one device name
> > later.
> >
> > The mechanism I used for getting a different bd_dev was partitioning two
> > different devices in two different orders.
>
> Ok, so we have a btrfs_device without a bdev around, which seems a bit
> dangerous. Also relying on the dev_t for any kind of device identify
> seems very dangerous. Aren't there per-device UUIDs or similar
> identifiers that are actually reliabe and can be used instead of the
> dev_t?
>
I was led to believe this wasn't possible while still actually
implementing temp_fsid. But now that I think of it again, I am less sure.
You could imagine them having identical images except a device uuid and the
code being smart enough to handle that.
Maybe Anand can explain why that wouldn't work :)
next prev parent reply other threads:[~2024-03-08 17:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-08 2:45 [PATCH v2] btrfs: validate device maj:min during open Anand Jain
2024-03-08 15:48 ` Christoph Hellwig
2024-03-08 16:04 ` Anand Jain
2024-03-08 16:10 ` Christoph Hellwig
2024-03-08 16:23 ` Anand Jain
2024-03-08 17:23 ` Christoph Hellwig
2024-03-08 17:32 ` Boris Burkov
2024-03-08 17:42 ` Christoph Hellwig
2024-03-08 17:51 ` Boris Burkov [this message]
2024-03-13 16:24 ` Anand Jain
2024-03-08 17:41 ` Boris Burkov
2024-03-12 19:17 ` Boris Burkov
2024-03-13 10:25 ` Anand Jain
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=20240308175133.GA2470614@zen.localdomain \
--to=boris@bur.io \
--cc=anand.jain@oracle.com \
--cc=dsterba@suse.com \
--cc=hch@infradead.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=stable@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