All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/2] btrfs-progs: read device fsid from the sysfs
Date: Tue, 19 Oct 2021 08:23:43 +0800	[thread overview]
Message-ID: <cover.1634598659.git.anand.jain@oracle.com> (raw)

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(-)

-- 
2.31.1


             reply	other threads:[~2021-10-19  0:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19  0:23 Anand Jain [this message]
2021-10-19  0:23 ` [PATCH 1/2] btrfs-progs: prepare helper device_is_seed Anand Jain
2021-10-19  0:23 ` [PATCH 2/2] btrfs-progs: read fsid from the sysfs in device_is_seed Anand Jain
2021-10-19 14:03   ` Josef Bacik
2021-10-20  2:40     ` Anand Jain
2021-10-20 13:47       ` Josef Bacik
2021-10-19 14:04 ` [PATCH 0/2] btrfs-progs: read device fsid from the sysfs Josef Bacik
2021-10-20  2:41   ` Anand Jain
2022-01-06  0:04 ` Anand Jain
2022-01-11 15:19   ` Nikolay Borisov
2022-01-21  9:29     ` Anand Jain
2022-08-26  0:14       ` Wang Yugui
2022-08-26 10:18         ` Anand Jain
2022-08-27  0:52           ` Wang Yugui
2022-08-10 10:18 ` Qu Wenruo
2022-08-10 11:18   ` Anand Jain
2022-08-10 11:43     ` Qu Wenruo

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=cover.1634598659.git.anand.jain@oracle.com \
    --to=anand.jain@oracle.com \
    --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.