Skip to content

btrfs-progs: read device fsid from the sysfs

Anand Jain linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs-progs: prepare helper device_is_seedcmds/filesystem-usage.c+18 -30 replies
2/2btrfs-progs: read fsid from the sysfs in device_is_seedcmds/filesystem-usage.c+30 -83 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchJosef Bacik
1/2
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] btrfs-progs: read device fsid from the sysfs

The following test case fails as it trying to read the fsid from the sb for a missing device.

   $ mkfs.btrfs -f -draid1 -mraid1 $DEV1 $DEV2 
   $ btrfstune -S 1 $DEV1 
   $ wipefs -a $DEV2 
   $ btrfs dev scan --forget 
   $ mount -o degraded $DEV1 /btrfs 
   $ btrfs device add $DEV3 /btrfs -f 
   $ btrfs fi us /btrfs 
     ERROR: unexpected number of devices: 1 >= 1 
     ERROR: if seed device is used, try running this command as root

The kernel patch [1] in the mailing list provided a sysfs interface to read the fsid of the device, so use it instead.

[1] btrfs: sysfs add devinfo/fsid to retrieve fsid from the device

This patch also retains the old method that is to read the SB for backward compatibility purposes.

Anand Jain (2):
btrfs-progs: prepare helper device_is_seed
btrfs-progs: read fsid from the sysfs in device_is_seed

 cmds/filesystem-usage.c | 47 ++++++++++++++++++++++++++++++++++++-----
 1 file changed, 42 insertions(+), 5 deletions(-)
Signature · 1 line
2.31.1