summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-09-08 11:22:48 +0200
committerDavid Sterba <dsterba@suse.com>2016-10-03 11:33:15 +0200
commit67331815018aac15347a02fcf553e7613bd05ad4 (patch)
tree7991b3693f84c62159aaa36dac859abab1545b16
parent1497a772c33c2a9fe0e25400db3d0c07b78eea63 (diff)
btrfs-progs: convert: improve error handling in do_rollback
Handle transaction errors. Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--btrfs-convert.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/btrfs-convert.c b/btrfs-convert.c
index ef9ba909..936d4682 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) {