From: Goffredo Baroncelli <kreijack@inwind.it>
To: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
Cc: linux-btrfs@vger.kernel.org, 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
Subject: Re: [PATCH 0/2] Supporting same fsid filesystems mounting on btrfs
Date: Thu, 4 May 2023 23:09:39 +0200 [thread overview]
Message-ID: <e42e2e38-2c79-c14e-a06b-65d94c37e3db@inwind.it> (raw)
In-Reply-To: <1818142b-ec3a-323d-7a8d-0b93c33756fc@igalia.com>
On 04/05/2023 22.10, Guilherme G. Piccoli wrote:
> On 04/05/2023 16:28, Goffredo Baroncelli wrote:
>> [...]
>> Hi Guilherme,
>>
>> did you tried to run "btrfs dev scan --forget /dev/sd.." before
>> mount the filesystem ?
>>
>> Assuming that you have two devices /dev/sdA and /dev/sdB with two btrfs
>> filesystem with the same uuid, you should mount /dev/sdA
>>
>> btrfs dev scan --forget /dev/sdB # you can use event /dev/sdA
>> mount /dev/sdA /mnt/target
>>
>> and to mount /dev/sdB
>>
>> btrfs dev scan --forget /dev/sdA # you can use event /dev/sdB
>> mount /dev/sdB /mnt/target
>>
>> I made a quick test using two loop devices and it seems that it works
>> reliably.
>
> Hi Goffredo, thanks for your suggestion!
>
> This seems interesting with regards the second patch here..indeed, I can
> mount any of the 2 filesystems if I use the forget option - interesting
> option, wasn't aware of that.
>
> But unfortunately it seems limited to mounting one device at a time, and
> we need to be able to mount *both* of them, due to an installation step.
> If I try to forget the device that is mounted, it gets (obviously) a
> "busy device" error.
Ahh, I didn't realized that you want to mount the two FS at the
same time.
>
> Is there any missing step from my side, or mounting both devices is
> really a limitation when using the forget option?
>
From my limited BTRFS internal knowledge, I think that your patches
takes the correct approach: using the "metadata_uuid" code to allow
two filesystems with the same uuid to exist at the same time.
>
>>
>> Another option should be make a kernel change that "forget" the device
>> before mounting *if* the filesystem is composed by only one device (
>> and another few exceptions like the filesystem is already mounted).
>>
>> This would avoid all the problem related to make a "temporary" uuid.
>
> I guess again this would be useful in the scope of the second patch
> here...we could check the way you're proposing instead of having the
> module parameter. In a way this is similar to the forget approach,
> right? But it's kind of an "automatic" forget heh
>
> How btrfs would know it is a case for single-device filesystem? In other
> words: how would we distinguish between the cases we want to auto-forget
> before mounting, and the cases in which this behavior is undesired?
If I remember correctly in the super-block there is the number of disks
that compose the filesystem. If the count is 1, it should be safe to
forget-before-mount the filesystem (or to not store in the cache
after a scan)
>
> Thanks again for your feedback, it is much appreciated.
> Cheers,
>
>
> Guilherme
--
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D 17B2 0EDA 9B37 8B82 E0B5
next prev parent reply other threads:[~2023-05-04 21:10 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
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 [this message]
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=e42e2e38-2c79-c14e-a06b-65d94c37e3db@inwind.it \
--to=kreijack@inwind.it \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=gpiccoli@igalia.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=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).