btrfs-progs: device add should check existing FS before adding
authorAnand Jain <anand.jain@oracle.com>
Fri, 27 Sep 2013 17:30:05 +0000 (01:30 +0800)
committerChris Mason <chris.mason@fusionio.com>
Wed, 16 Oct 2013 12:23:11 +0000 (08:23 -0400)
commit1fdf85a3a30b139c02865bcf599fe5c461857f70
treea79427040cb3f2fa958e1624fb9b342dee8aa671
parentc31c50f3309110162f345b6b07389ff6e7e929d4
btrfs-progs: device add should check existing FS before adding

as of now, when 'btrfs device add' adds a device it doesn't
check if the given device contains an existing FS. This
patch will change that to check the same. which when true
add will fail, and ask user to use -f option to overwrite.

further, since now we have test_dev_for_mkfs() function
to check if a disk can be used, so this patch will also
use this function to test the given device before adding.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
cmds-device.c
man/btrfs.8.in