summaryrefslogtreecommitdiff
path: root/transaction.c
diff options
context:
space:
mode:
Diffstat (limited to 'transaction.c')
-rw-r--r--transaction.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/transaction.c b/transaction.c
index ecafbb15..1e2a7b96 100644
--- a/transaction.c
+++ b/transaction.c
@@ -74,7 +74,8 @@ static int update_cowonly_root(struct btrfs_trans_handle *trans,
ret = btrfs_update_root(trans, tree_root,
&root->root_key,
&root->root_item);
- BUG_ON(ret);
+ if (ret < 0)
+ return ret;
btrfs_write_dirty_block_groups(trans, root);
}
return 0;
@@ -102,9 +103,11 @@ int commit_tree_roots(struct btrfs_trans_handle *trans,
next = fs_info->dirty_cowonly_roots.next;
list_del_init(next);
root = list_entry(next, struct btrfs_root, dirty_list);
- update_cowonly_root(trans, root);
+ ret = update_cowonly_root(trans, root);
free_extent_buffer(root->commit_root);
root->commit_root = NULL;
+ if (ret < 0)
+ return ret;
}
return 0;
@@ -168,7 +171,8 @@ commit_tree:
ret = commit_tree_roots(trans, fs_info);
BUG_ON(ret);
ret = __commit_transaction(trans, root);
- BUG_ON(ret);
+ if (ret < 0)
+ goto out;
write_ctree_super(trans);
btrfs_finish_extent_commit(trans, fs_info->extent_root,
&fs_info->pinned_extents);
@@ -177,7 +181,8 @@ commit_tree:
root->commit_root = NULL;
fs_info->running_transaction = NULL;
fs_info->last_trans_committed = transid;
- return 0;
+out:
+ return ret;
}
void btrfs_abort_transaction(struct btrfs_trans_handle *trans, int error)