summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/relocation.c
diff options
context:
space:
mode:
authorLiu Bo2013-03-04 17:25:40 +0100
committerJosef Bacik2013-03-04 22:33:23 +0100
commit0f788c58194e4ccc5b3ab23f872c5e18542335e4 (patch)
tree5e950eb614b23cef93e0348e94ed3e65ff1abe64 /fs/btrfs/relocation.c
parentBtrfs: do not BUG_ON in prepare_to_reloc (diff)
downloadkernel-qcow2-linux-0f788c58194e4ccc5b3ab23f872c5e18542335e4.tar.gz
kernel-qcow2-linux-0f788c58194e4ccc5b3ab23f872c5e18542335e4.tar.xz
kernel-qcow2-linux-0f788c58194e4ccc5b3ab23f872c5e18542335e4.zip
Btrfs: do not BUG_ON on aborted situation
Btrfs balance can easily hit BUG_ON in these places, but we want to it bail out gracefully after we force the whole filesystem to readonly. So we use btrfs_std_error hook in place of BUG_ON. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r--fs/btrfs/relocation.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 9d13786eec73..3ebe87977aae 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -3771,7 +3771,11 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc)
while (1) {
progress++;
trans = btrfs_start_transaction(rc->extent_root, 0);
- BUG_ON(IS_ERR(trans));
+ if (IS_ERR(trans)) {
+ err = PTR_ERR(trans);
+ trans = NULL;
+ break;
+ }
restart:
if (update_backref_cache(trans, &rc->backref_cache)) {
btrfs_end_transaction(trans, rc->extent_root);