From: Wang Shilong <[email protected]>

I hit a BUG_ON() when inserting reloc root into rc->reloc_root_tree.rb_root,
the fact is block bytenr has been inserted before, this is really a redicious
bug, the reason is that we freed root node after we have allocated root
node block,and this block bytenr will be reused and then oops happens.

Signed-off-by: Wang Shilong <[email protected]>
---
 fs/btrfs/relocation.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index ce459a7..4dc7f26 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -1361,7 +1361,6 @@ static struct btrfs_root *create_reloc_root(struct 
btrfs_trans_handle *trans,
        }
 
        btrfs_tree_unlock(eb);
-       free_extent_buffer(eb);
 
        ret = btrfs_insert_root(trans, root->fs_info->tree_root,
                                &root_key, root_item);
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to