Btrfs-progs: change the way mkfs picks raid profiles
authorIlya Dryomov <idryomov@gmail.com>
Mon, 12 Dec 2011 18:00:25 +0000 (20:00 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 12 Dec 2011 18:00:25 +0000 (20:00 +0200)
commita46e7ff22ed8e0e8567a36cd226a910a1fab47d7
tree8bb16c37b139deb1feba14fdd852e6556ff78fff
parentd5734e88370bc7bfe83e9d33b6f51c905a8fb91e
Btrfs-progs: change the way mkfs picks raid profiles

Currently mkfs in response to

  mkfs.btrfs -d raid10 dev1 dev2

instead of telling "you can't do that" creates a SINGLE on two devices,
and only rebalance can transform it to raid0.  Generally, it never warns
users about decisions it makes and it's not at all obvious which profile
it picks when.

Fix this by checking the number of effective devices and reporting back
if the specified profile is impossible to create.  Do not create FS in
case invalid profile was given.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
mkfs.c