From: David Sterba Date: Thu, 8 Sep 2016 09:22:48 +0000 (+0200) Subject: btrfs-progs: convert: improve error handling in do_rollback X-Git-Tag: upstream/4.16.1~1256 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=67331815018aac15347a02fcf553e7613bd05ad4;p=platform%2Fupstream%2Fbtrfs-progs.git btrfs-progs: convert: improve error handling in do_rollback Handle transaction errors. Signed-off-by: David Sterba --- diff --git a/btrfs-convert.c b/btrfs-convert.c index ef9ba90..936d468 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -2822,7 +2822,10 @@ next_extent: /* force no allocation from system block group */ root->fs_info->system_allocs = -1; trans = btrfs_start_transaction(root, 1); - BUG_ON(!trans); + if (!trans) { + error("unable to start transaction"); + goto fail; + } /* * recow the whole chunk tree, this will remove all chunk tree blocks * from system block group @@ -2871,7 +2874,10 @@ next_extent: } ret = btrfs_commit_transaction(trans, root); - BUG_ON(ret); + if (ret) { + error("transaction commit failed: %d", ret); + goto fail; + } ret = close_ctree(root); if (ret) {