linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: dsterba@suse.cz, Qu Wenruo <wqu@suse.com>
Cc: Josef Bacik <josef@toxicpanda.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 4/6] btrfs-progs: use a unified btrfs_make_subvol() implementation
Date: Wed, 25 Oct 2023 07:14:58 +1030	[thread overview]
Message-ID: <136e8bf5-3b77-4e66-be24-54cd7e14b83a@gmx.com> (raw)
In-Reply-To: <20231024173806.GR26353@suse.cz>



On 2023/10/25 04:08, David Sterba wrote:
> On Wed, Oct 18, 2023 at 10:20:57AM +1030, Qu Wenruo wrote:
>>>>> We're moving towards a world where kernel-shared will be an exact-ish copy of
>>>>> the kernel code.  Please put helpers like this in common/, I did this for
>>>>> several of the extent tree related helpers we need for fsck, this is a good fit
>>>>> for that.  Thanks,
>>>>
>>>> Sure, and this also reminds me to copy whatever we can from kernel.
>>>
>>> I do syncs from kernel before a release but all the low hanging fruit is
>>> probably gone so it needs targeted updates.
>>
>> For the immediate target it's btrfs_inode and involved VFS structures
>> for inodes/dir entries.
>>
>> In progs we don't have a structure to locate a unique inode (need both
>> rootid and ino number), nor to do any path resolution.
>>
>> This makes it almost impossible to proper sync the code.
>>
>> But introduce btrfs_inode to btrfs-progs would also be a little
>> overkilled, as we don't have that many users.
>> (Only the new --rootdir with --subvol combination).
>
> I have an idea for using this functionality, but you may not like it -
> we could implement FUSE.

In fact I really like it.

> The missing code is exactly about inodes, path
> resolution and subvolumes. You have the other project, with a different
> license, although there's a lot shared code. You can keep it so u-boot
> can do the sync and keep the read-only support. I'd like to have full
> read-write support with subvolumes and devices (if there's ioctl pass
> through), but it's not urgent. Having the basic inode/path support would
> be good for mkfs even in a smaller scope.

The existing blockage would be fsck.
If we want FUSE, inode is super handy, but for fsck doing super low
level fixes, it can be a burden instead.
As it needs to repair INODE_REF/DIR_INDEX/DIR_ITEMs, sometimes even
missing INODE_ITEMs, not sure how hard it would be to maintain both
btrfs_inode and low-level code.


There are one big limiting factor in FUSE, we can not control the device
number, unlike kernel.
This means even we implemented the subvolume code (like my btrfs-fuse
project), there is no way to detect subvolume boundary.


Then comes with some other super personal concerns:

- Can we go Rust instead of C?

- Can we have a less restrict license to maximize the possibility of
   code share?
   Well, I should ask this question to GRUB....
   But a more hand-free license like MIT may really help for bootloaders.

Thanks,
Qu

  reply	other threads:[~2023-10-24 20:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16  4:38 [PATCH 0/6] btrfs-progs: mkfs: introduce an experimental --subvol option Qu Wenruo
2023-10-16  4:38 ` [PATCH 1/6] btrfs-progs: enhance btrfs_mkdir() function Qu Wenruo
2023-10-16  4:38 ` [PATCH 2/6] btrfs-progs: enhance and rename btrfs_mksubvol() function Qu Wenruo
2023-10-16  4:38 ` [PATCH 3/6] btrfs-progs: enhance btrfs_create_root() function Qu Wenruo
2023-10-16  4:38 ` [PATCH 4/6] btrfs-progs: use a unified btrfs_make_subvol() implementation Qu Wenruo
2023-10-17 13:49   ` Josef Bacik
2023-10-17 20:14     ` Qu Wenruo
2023-10-17 23:11       ` David Sterba
2023-10-17 23:50         ` Qu Wenruo
2023-10-24 17:38           ` David Sterba
2023-10-24 20:44             ` Qu Wenruo [this message]
2023-10-25 16:18               ` David Sterba
2023-10-25 22:41                 ` Qu Wenruo
2023-10-25 22:57                 ` Neal Gompa
2023-10-16  4:38 ` [PATCH 5/6] btrfs-progs: mkfs: introduce experimental --subvol option Qu Wenruo
2023-10-17 13:54   ` Josef Bacik
2023-10-17 20:13     ` Qu Wenruo
2023-10-16  4:38 ` [PATCH 6/6] btrfs-progs: mkfs-tests: introduce a test case to verify " Qu Wenruo
2023-10-19 18:19 ` [PATCH 0/6] btrfs-progs: mkfs: introduce an experimental " Goffredo Baroncelli

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=136e8bf5-3b77-4e66-be24-54cd7e14b83a@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=dsterba@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.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).