path: root/mkfs.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 /mkfs.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 'mkfs.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/mkfs.c b/mkfs.c
index ade85c78..60f906cd 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -1534,7 +1534,7 @@ int main(int ac, char **av)
nodesize, leafsize,
sectorsize, stripesize);
if (ret) {
- fprintf(stderr, "error during mkfs %d\n", ret);
+ fprintf(stderr, "error during mkfs: %s\n", strerror(-ret));