btrfs-progs: Introduce device delete by devid
authorAnand Jain <Anand.Jain@oracle.com>
Mon, 14 Mar 2016 08:31:49 +0000 (16:31 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 14 Mar 2016 13:11:33 +0000 (14:11 +0100)
commit2490de5da527969a9178418155120bf50f2a8421
tree4ae37e53ae99a6eaf7aa1d82a0508103ed4fda35
parent5f17513313ddd39d4348b382cf2224dbf4d35e7b
btrfs-progs: Introduce device delete by devid

This patch introduces new option <devid> for the command

  btrfs device delete <device_path|devid>[..]  <mnt>

In a user reported issue on a 3-disk-RAID1, one disk failed with its
SB unreadable. Now with this patch user will have a choice to delete
the device using devid.

The other method we could do, is to match the input device_path
to the available device_paths with in the kernel. But that won't
work in all the cases, like what if user provided mapper path
when the path within the kernel is a non-mapper path.

This patch depends on the below kernel patch for the new feature to work,
however it will fail-back to the old interface for the kernel without the
patch

  Btrfs: Introduce device delete by devid

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Documentation/btrfs-device.asciidoc
cmds-device.c
ioctl.h