path: root/btrfs-convert.c
diff options
authorFilipe David Borba Manana <>2013-07-04 10:48:39 +0100
committerDavid Sterba <>2013-08-09 14:32:33 +0200
commit2e9adfb90975852ce46692f0d433e3a9fcc78749 (patch)
treeb7fc44b0dc1f13647eccf018185c98ac71e829ac /btrfs-convert.c
parent80bab0f18c8a9ed76a392ae5bfafc8b038bb41b9 (diff)
Btrfs-progs: return error on write failure in make_btrfs()
Instead of aborting with a BUG_ON() statement, return a negated errno code. Also updated mkfs and convert tools to print a nicer error message when make_btrfs() returns an error. Signed-off-by: Filipe David Borba Manana <> Signed-off-by: David Sterba <> Signed-off-by: Chris Mason <>
Diffstat (limited to 'btrfs-convert.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/btrfs-convert.c b/btrfs-convert.c
index cb967901..c500ddd1 100644
--- a/btrfs-convert.c
+++ b/btrfs-convert.c
@@ -2323,7 +2323,8 @@ int do_convert(const char *devname, int datacsum, int packing, int noxattr)
blocks, total_bytes, blocksize, blocksize,
blocksize, blocksize);
if (ret) {
- fprintf(stderr, "unable to create initial ctree\n");
+ fprintf(stderr, "unable to create initial ctree: %s\n",
+ strerror(-ret));
goto fail;
/* create a system chunk that maps the whole device */