btrfs-progs: mkfs should first check all disks before writing to a disk
authorAnand Jain <anand.jain@oracle.com>
Mon, 15 Apr 2013 06:38:09 +0000 (14:38 +0800)
committerDavid Sterba <dsterba@suse.cz>
Tue, 23 Apr 2013 16:56:20 +0000 (18:56 +0200)
commit4b3c9136be2b72fe4df33c5dfa7a33cf1bce9d8d
treef82152525ae31b30a26e5784319b4ee310d5af55
parent9b5a329c6cd9f89f0ed83300620581778b90d026
btrfs-progs: mkfs should first check all disks before writing to a disk

In the cases where one of the disk is not suitable for
btrfs, then we would fail the mkfs, however we determine
that after we have written btrfs to the preceding disks.
At this time if user changes mind for not to use btrfs
will left with no choice.

So this patch will check if all the provided disks are
suitable for the btrfs at once before proceeding to
create btrfs on a disk.

Further this patch also removed duplicate code to check
device suitability for the btrfs.

Next, there is an existing bug about the -r mkfs option,
which this patch would carry forward most of it.
Ref:
[PATCH 2/2, RFC] btrfs-progs: overhaul mkfs.btrfs -r option

Signed-off-by: Anand Jain <anand.jain@oracle.com>
to merg prev

Signed-off-by: Anand Jain <anand.jain@oracle.com>
mkfs.c
utils.c
utils.h