btrfs-progs: Add further checks to btrfs replace start command
authorGoffredo Baroncelli <kreijack@gmail.com>
Thu, 20 Aug 2015 05:24:23 +0000 (07:24 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 31 Aug 2015 17:25:12 +0000 (19:25 +0200)
commitd7748770a78a4a44f39f4f0e629885a255d24d90
treeab3f0170569b9adcf2d4a9fb237c2b444ceb8057
parentb651b8ca7eb70bf82ebdb0d199c64be0109ff2b1
btrfs-progs: Add further checks to btrfs replace start command

Add further checks to btrfs replace start command.

The following tests where added in user space before calling
the ioctl():
1) check if the new disk is greather or equal to the old one
2) check if the source device is or a block device or a
numerical dev-id

These checks are already performed in kernel space; however
when "btrfs replace start" is ran in background is not possible
to show any error returned by the ioctl(), so in case of fail
the user had to check dmesg to understand the what happened.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-replace.c