All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Goffredo Baroncelli <kreijack@inwind.it>
Cc: Anand Jain <anand.jain@oracle.com>,
	dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH RFC] btrfs: pick device with lowest devt for show_devname
Date: Tue, 5 Dec 2023 18:44:43 +0100	[thread overview]
Message-ID: <20231205174443.GP2751@twin.jikos.cz> (raw)
In-Reply-To: <183599a4-392d-443d-b914-7ac830b3c2d7@inwind.it>

On Wed, Nov 29, 2023 at 09:54:02PM +0100, Goffredo Baroncelli wrote:
> On 29/11/2023 00.28, Anand Jain wrote:
> > 
> > 
> > On 28/11/2023 16:00, Goffredo Baroncelli wrote:
> >> 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.
> [...]
> > 
> > Regarding libblkid for Btrfs device discovery, I m little confused what are you referring to, an example would be helpful.
> 
> I developed a little utility to build for each btrfs filesystem:
> - all the devices involved
> - all the mountpoint (if any) where the filesystem is mounted and the subvolume used as root.
> 
> It was nice because it got all these information only using:
> - libblkid
> - parsing /proc/self/mountinfo

I think if there's one consistent approach based on libblkid then all
the related tools and projects can use that.

  reply	other threads:[~2023-12-05 17:51 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
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 [this message]
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=20231205174443.GP2751@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=anand.jain@oracle.com \
    --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.