All of lore.kernel.org
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@libero.it>
To: Anand Jain <anand.jain@oracle.com>, dsterba@suse.cz
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH RFC] btrfs: pick device with lowest devt for show_devname
Date: Tue, 28 Nov 2023 09:00:06 +0100	[thread overview]
Message-ID: <2248a4d7-bbd0-4bf3-992a-c1e13c8f2c20@libero.it> (raw)
In-Reply-To: <589d8650-26e8-4c0e-a602-bdb5ce427ed5@oracle.com>

On 27/11/2023 12.48, Anand Jain wrote:
> 
> 
> On 11/25/23 09:09, Anand Jain wrote:
[...]
>> I am skeptical about whether we have a strong case to create a single
>> pseudo device per multi-device Btrfs filesystem, such as, for example
>> '/dev/btrfs/<fsid>-<random>/rootid=5' and which means pseudo device
>> will carry the btrfs-magic and the actual blk devices something else.
>>
>> OR for now, regarding the umount issue mentioned above, we just can
>> document it for the users to be aware of.
>>
>> Any feedback is greatly appreciated.
>>
> 
> How about if we display the devices list in the options, so that
> user-land libs have something in the mount-table that tells all
> the devices part of the fsid?
> 
> For example:
> $ cat /proc/self/mounts | grep btrfs
> 
> /dev/sda1 /btrfs btrfs rw,relatime,space_cache=v2,subvolid=5,subvol=/,device=/dev/sda2,device=/dev/sdb3  0 0
> 

When I developed code to find a btrfs mount point from a disk, I had to
consider all the devices involved and check if one is in /proc/self/mounts.

Putting the devices list as device=<xxx>,device=<yyy> doesn't change anything because
the code has to manage a btrfs filesistem as "special" in any case.
To get the map <btrfs-uuid> <-> <devices-list> I used libblkid.

I think that a "saner" way to manage this issue, is to patch "mount" to
consider the special needing of btrfs.

Pay attention to consider also events like, removing a device, adding a device:
after these events how /dev/disk/by-uuid/ would be updated ?

What about bcachefs ? Does it have the same issue ? If yes this may be
a further reason to patch "mount" instead relying to a rule (pick the
lowest devt) spread for all the projects (systemd, mount...).

> Thanks.
> 

-- 
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5


  reply	other threads:[~2023-11-28  8:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02 11:10 [PATCH RFC] btrfs: pick device with lowest devt for show_devname Anand Jain
2023-11-02 20:26 ` David Sterba
2023-11-02 22:55   ` Anand Jain
2023-11-20 14:42     ` David Sterba
2023-11-24 16:19 ` David Sterba
2023-11-25  1:09   ` Anand Jain
2023-11-27 11:48     ` Anand Jain
2023-11-28  8:00       ` Goffredo Baroncelli [this message]
2023-11-28 23:28         ` Anand Jain
2023-11-29 13:38           ` Andrei Borzenkov
2023-11-29 20:54           ` Goffredo Baroncelli
2023-12-05 17:44             ` David Sterba
2023-12-06 19:52               ` Goffredo Baroncelli
2023-12-05 17:43         ` David Sterba
2023-11-29 21:20 ` 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=2248a4d7-bbd0-4bf3-992a-c1e13c8f2c20@libero.it \
    --to=kreijack@libero.it \
    --cc=anand.jain@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=kreijack@inwind.it \
    --cc=linux-btrfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.