From 3d0ca17f20e91faf8727bd1bf0490e015d12fc6a Mon Sep 17 00:00:00 2001 From: Liu Bo Date: Mon, 4 Mar 2013 16:25:39 +0000 Subject: [PATCH] --- yaml --- r: 361004 b: refs/heads/master c: 288189471d7e12fb22c37870e151833f438deea8 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/btrfs/relocation.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index b42641f21791..7e3c87301495 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e1a1267054ea9dcafd01636e52d441f809efad5e +refs/heads/master: 288189471d7e12fb22c37870e151833f438deea8 diff --git a/trunk/fs/btrfs/relocation.c b/trunk/fs/btrfs/relocation.c index 7d1654cf9d48..9d13786eec73 100644 --- a/trunk/fs/btrfs/relocation.c +++ b/trunk/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; }