From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: kreijack@inwind.it, dsterba@suse.cz, Mark Harmstone <maharmstone@fb.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v5] btrfs-progs: add --subvol option to mkfs.btrfs
Date: Tue, 13 Aug 2024 07:38:22 +0930 [thread overview]
Message-ID: <77cda2a4-08ae-47b9-8efd-e3ca0e8fe9bc@gmx.com> (raw)
In-Reply-To: <1af5c6be-27ff-4dd5-ba5e-9213bd1e9f68@inwind.it>
在 2024/8/12 21:12, Goffredo Baroncelli 写道:
> On 11/08/2024 00.40, Qu Wenruo wrote:
[...]
>>
>> Personally speaking, I would prefer the current scheme way more than the
>> out of tree subvolumes.
>>
>> It's super easy to have something like this:
>>
>> rootdir
>> |- dir1
>> |- dir2
>>
>> Then you specify "--rootdir rootdir and --subvolume /somewhereelse/dir1"
>>
>> This is going to lead filename conflicts and mostly an EEXIST to end the
>> operation.
>
> I am not sure to fully understand to what you means as "filename
> conflicts";
> anyhow, now you have the ENOEXIST problem :-)
I mean, if you support specifying a out of rootdir subvolume, along with
rootdir, then it's going to cause conflicts (the file from rootdir with
the same filename conflicts with the out-of-rootdir subvolume)
>
>>
>>
>> From my understand, the "--rootdir" along with "--subvol" is mostly
>> used to populate a fs image for distro building.
>>
>> If you really want just a single subvolume, why won't "--rootdir rootdir
>> --subvol dir1" work for you?
>>
>> If your only goal is to reduce parameters, then your next question is
>> already answering why the idea is a bad one.
>
>
> The use case that I have in my mind is to create a filesystem with a
> default
> non root sub-volume, and nothing more.
You ignored all the things like owner/group/privilege bits and maybe
even xattrs (for SELINUX) that will be needed.
> This would prevent the typical
> problem
> that you face when you populate the root-subvolume, then snapshot it and
> then
> revert to an old snapshot, swapping the subvolumes.
> It is not easy to swap the root subvolume, because it is a special in
> the sense
> that it cannot be deleted and it is the root of all subvolumes.
A seemingly simple solution is not always that simple.
And I can always argue that, for your "simple" subvolume case, why not
just mount it and create one?
Especially that one needs to set the default subvolume of the fs anyway.
>
> Being so I think that it is better to avoid to have the root subvolume as
> default sub-volume.
>
> For my goal (having a filesystem with a non root default sub-volume)
> creating a
> template filesystem is waste of effort.
>
> Now these two use cases (my one, and the one related to this patch) have
> a lot
> in common. So I trying to find a way so the two can be joined.
Unfortunately, as long as you're creating a subvolume, you need all the
details you ignored (which makes the use case looking simple).
In that case, it's just a subset of the feature of Mark's patch.
Meanwhile Mark's solution provides all the information needed, thus I
see no reason to introduce extra interfaces especially when Mark's
solution is already a superset.
Thanks,
Qu
>
>>
>>>
>>> However, this would lead to the queston: which user and permission has
>>> to be set to those subvolumes ?
>>> So I think that we need a further parameter like "--subvol-perm" and
>>> "--subvol-owner"...
>>
>> Nope, the current code is already handling that way better.
>> The user/owner and modes are from the rootdir.
>>
>> Meanwhile your idea is just asking for extra problems.
>>
>> Thanks,
>> Qu
>>
>>>
>>> BR
>>>
>
>
next prev parent reply other threads:[~2024-08-12 22:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 17:17 [PATCH v5] btrfs-progs: add --subvol option to mkfs.btrfs Mark Harmstone
2024-08-09 19:31 ` David Sterba
2024-08-10 9:53 ` Goffredo Baroncelli
2024-08-10 22:40 ` Qu Wenruo
2024-08-12 11:42 ` Goffredo Baroncelli
2024-08-12 14:39 ` Mark Harmstone
2024-08-12 22:08 ` Qu Wenruo [this message]
2024-08-14 21:57 ` David Sterba
2024-08-14 22:11 ` Qu Wenruo
2024-08-14 22:20 ` David Sterba
2024-08-13 0:52 ` Anand Jain
2024-08-13 10:38 ` Mark Harmstone
2024-08-14 21:47 ` David Sterba
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=77cda2a4-08ae-47b9-8efd-e3ca0e8fe9bc@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=dsterba@suse.cz \
--cc=kreijack@inwind.it \
--cc=linux-btrfs@vger.kernel.org \
--cc=maharmstone@fb.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