mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
e1a1267054
commit
288189471d
1 changed files with 9 additions and 1 deletions
|
@ -3731,7 +3731,15 @@ int prepare_to_relocate(struct reloc_control *rc)
|
||||||
set_reloc_control(rc);
|
set_reloc_control(rc);
|
||||||
|
|
||||||
trans = btrfs_join_transaction(rc->extent_root);
|
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);
|
btrfs_commit_transaction(trans, rc->extent_root);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue