btrfs-progs: provide better error message for raid profile mismatch
authorHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Fri, 16 May 2014 08:20:56 +0000 (17:20 +0900)
committerDavid Sterba <dsterba@suse.cz>
Thu, 4 Dec 2014 15:48:12 +0000 (16:48 +0100)
commit373110d84f3a1c5bdd305d2e6dcaeb98b5e6dbe7
tree651a061d10abd102fcc90a4da6919b9f82aaec2e
parent3ab60c6a624b64a3bdd8952d49f0683054fdee10
btrfs-progs: provide better error message for raid profile mismatch

Current error messages are like following:
  Error: unable to create FS with metadata profile 32 (have 2 devices)
  Error: unable to create FS with metadata profile 256 (have 2 devices)

Obviously it is hard for users to interpret "profile XX" to proper
meaning, such as "raidN". So use recongizable string instead of
internal numerical value. In case of "DUP", use an explicit message.

Plus this patch fix a bug that message mistake metadata profile
for data profile.

After applying this patch, messages will be like:
  Error: DUP is not allowed when FS have multiple devices
  Error: unable to create FS with metadata profile RAID6 (have 2
  devices but 3 devices are required)

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
utils.c