linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>, linux-btrfs@vger.kernel.org
Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com,
	linux-fsdevel@vger.kernel.org, kernel@gpiccoli.net,
	kernel-dev@igalia.com, vivek@collabora.com,
	ludovico.denittis@collabora.com, johns@valvesoftware.com,
	nborisov@suse.com
Subject: Re: [PATCH 1/2] btrfs: Introduce the virtual_fsid feature
Date: Fri, 5 May 2023 12:51:41 -0300	[thread overview]
Message-ID: <12aa446b-39c7-c9fb-c3a4-70bfb57d9bbc@igalia.com> (raw)
In-Reply-To: <2892ff0d-9225-07b7-03e4-a3c96d0bff59@gmx.com>

On 05/05/2023 04:21, Qu Wenruo wrote:
> [...]
> Exactly, the biggest problem is the multi-device support.
> 
> Btrfs needs to search and assemble all devices of a multi-device
> filesystem, which is normally handled by things like LVM/DMraid, thus
> other traditional fses won't need to bother that.

Hi Qu, thanks a bunch for your feedback, and for validating my
understanding of the issue!


>  [...]
> 
> I would prefer a much simpler but more explicit method.
> 
> Just introduce a new compat_ro feature, maybe call it SINGLE_DEV.
> 
> By this, we can avoid multiple meanings of the same super member, nor
> need any special mount option.
> Remember, mount option is never a good way to enable/disable a new feature.
> 
> The better method to enable/disable a feature should be mkfs and btrfstune.
> 
> Then go mostly the same of your patch, but maybe with something extra:
> 
> - Disbale multi-dev code
>    Include device add/replace/removal, this is already done in your
>    patch.
> 
> - Completely skip device scanning
>    I see no reason to keep btrfs with SINGLE_DEV feature to be added to
>    the device list at all.
>    It only needs to be scanned at mount time, and never be kept in the
>    in-memory device list.
> 

This seems very interesting, but I'm a bit confused on how that would
work with 2 identical filesystem images mounted at the same time.

Imagine you have 2 devices, /dev/sda1 and /dev/sda2 holding the exact
same image, with the SINGLE_DEV feature set. They are identical, and
IIUC no matter if we skip scanning or disable any multi-device approach,
in the end both have the *same* fsid. How do we track this in the btrfs
code now? Once we try to mount the second one, it'll try to add the same
entity to the fs_uuids list...

That's the problem I faced when investigating the code and why the
proposal is to "spoof" the fsid with some random generated one.

Also, one more question: why do you say "Remember, mount option is never
a good way to enable/disable a new feature"? I'm not expert in
filesystems (by far heh), so I'm curious to fully understand your
point-of-view.

From my naive viewpoint, seems a mount option is "cheaper" than
introducing a new feature in the OS that requires changes on btrfs
userspace applications as well as to track incompatibilities in
different kernel versions.

Thanks again,


Guilherme

  parent reply	other threads:[~2023-05-05 15:51 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04 17:07 [PATCH 0/2] Supporting same fsid filesystems mounting on btrfs Guilherme G. Piccoli
2023-05-04 17:07 ` [PATCH 1/2] btrfs: Introduce the virtual_fsid feature Guilherme G. Piccoli
2023-05-05  7:21   ` Qu Wenruo
2023-05-05 13:38     ` David Sterba
2023-05-08 11:27       ` Anand Jain
2023-05-08 11:50         ` Qu Wenruo
2023-05-11 11:51           ` David Sterba
2023-05-11 14:12             ` Anand Jain
2023-05-14 21:25             ` Guilherme G. Piccoli
2023-05-05 15:51     ` Guilherme G. Piccoli [this message]
2023-05-05 22:15       ` Qu Wenruo
2023-05-08 22:49         ` Guilherme G. Piccoli
2023-05-05 17:34     ` Goffredo Baroncelli
2023-05-05 22:31       ` Qu Wenruo
2023-05-06 17:30         ` Goffredo Baroncelli
2023-05-06 23:00           ` Qu Wenruo
2023-07-05 22:52     ` Guilherme G. Piccoli
2023-07-06  0:53       ` Qu Wenruo
2023-07-06 22:32         ` Guilherme G. Piccoli
2023-05-05 13:18   ` David Sterba
2023-05-05 16:18     ` Guilherme G. Piccoli
2023-05-05 23:00       ` David Sterba
2023-05-08 22:59         ` Guilherme G. Piccoli
2023-05-08 23:18           ` Qu Wenruo
2023-05-08 23:49             ` Guilherme G. Piccoli
2023-05-09  0:02               ` Qu Wenruo
2023-05-04 17:07 ` [PATCH 2/2] btrfs: Add module parameter to enable non-mount scan skipping Guilherme G. Piccoli
2023-05-04 19:28 ` [PATCH 0/2] Supporting same fsid filesystems mounting on btrfs Goffredo Baroncelli
2023-05-04 20:10   ` Guilherme G. Piccoli
2023-05-04 21:09     ` Goffredo Baroncelli
2023-05-05 16:21       ` Guilherme G. Piccoli
2023-05-05  5:16 ` Anand Jain
2023-05-05 16:27   ` Guilherme G. Piccoli
2023-05-05 17:37     ` Goffredo Baroncelli
2023-05-05 18:15     ` Vivek Dasmohapatra
2023-05-07 23:10 ` Dave Chinner
2023-05-08 22:45   ` Guilherme G. Piccoli
2023-08-03 15:47 ` Guilherme G. Piccoli

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=12aa446b-39c7-c9fb-c3a4-70bfb57d9bbc@igalia.com \
    --to=gpiccoli@igalia.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=johns@valvesoftware.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-dev@igalia.com \
    --cc=kernel@gpiccoli.net \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=ludovico.denittis@collabora.com \
    --cc=nborisov@suse.com \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=vivek@collabora.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).