diff options
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r-- | fs/btrfs/relocation.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 7d1654cf9d48..9d13786eec73 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
@@ -3731,7 +3731,15 @@ int prepare_to_relocate(struct reloc_control *rc) | |||
3731 | set_reloc_control(rc); | 3731 | set_reloc_control(rc); |
3732 | 3732 | ||
3733 | trans = btrfs_join_transaction(rc->extent_root); | 3733 | trans = btrfs_join_transaction(rc->extent_root); |
3734 | BUG_ON(IS_ERR(trans)); | 3734 | if (IS_ERR(trans)) { |
3735 | unset_reloc_control(rc); | ||
3736 | /* | ||
3737 | * extent tree is not a ref_cow tree and has no reloc_root to | ||
3738 | * cleanup. And callers are responsible to free the above | ||
3739 | * block rsv. | ||
3740 | */ | ||
3741 | return PTR_ERR(trans); | ||
3742 | } | ||
3735 | btrfs_commit_transaction(trans, rc->extent_root); | 3743 | btrfs_commit_transaction(trans, rc->extent_root); |
3736 | return 0; | 3744 | return 0; |
3737 | } | 3745 | } |