aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2013-03-04 16:25:39 +0000
committerJosef Bacik <jbacik@fusionio.com>2013-03-04 16:33:23 -0500
commit288189471d7e12fb22c37870e151833f438deea8 (patch)
treee15070a254c9b16e919c315bee972d90176d8d28
parente1a1267054ea9dcafd01636e52d441f809efad5e (diff)
downloadkernel_goldelico_gta04-288189471d7e12fb22c37870e151833f438deea8.zip
kernel_goldelico_gta04-288189471d7e12fb22c37870e151833f438deea8.tar.gz
kernel_goldelico_gta04-288189471d7e12fb22c37870e151833f438deea8.tar.bz2
Btrfs: do not BUG_ON in prepare_to_reloc
We can bail out from here gracefully instead of a cold BUG_ON. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
-rw-r--r--fs/btrfs/relocation.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 7d1654c..9d13786 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -3731,7 +3731,15 @@ int prepare_to_relocate(struct reloc_control *rc)
set_reloc_control(rc);
trans = btrfs_join_transaction(rc->extent_root);
- BUG_ON(IS_ERR(trans));
+ if (IS_ERR(trans)) {
+ unset_reloc_control(rc);
+ /*
+ * extent tree is not a ref_cow tree and has no reloc_root to
+ * cleanup. And callers are responsible to free the above
+ * block rsv.
+ */
+ return PTR_ERR(trans);
+ }
btrfs_commit_transaction(trans, rc->extent_root);
return 0;
}