From: Daniel J Blueman Date: Fri, 27 Apr 2012 16:41:46 +0000 (-0400) Subject: Btrfs: Prevent root_list corruption X-Git-Tag: accepted/tizen/common/20141203.182822~4703^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1daf3540fa77faea2f91d96bcaf07ce48ee827be;p=platform%2Fkernel%2Flinux-arm64.git Btrfs: Prevent root_list corruption I was seeing root_list corruption on unmount during fs resize in 3.4-rc4; add correct locking to address this. Signed-off-by: Daniel J Blueman Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 017281d..5a105a0 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -1279,7 +1279,9 @@ static int __update_reloc_root(struct btrfs_root *root, int del) if (rb_node) backref_tree_panic(rb_node, -EEXIST, node->bytenr); } else { + spin_lock(&root->fs_info->trans_lock); list_del_init(&root->root_list); + spin_unlock(&root->fs_info->trans_lock); kfree(node); } return 0;