Commit 1daf3540 authored by Daniel J Blueman's avatar Daniel J Blueman Committed by Chris Mason

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: default avatarDaniel J Blueman <daniel@quora.org>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 3e74317a
...@@ -1279,7 +1279,9 @@ static int __update_reloc_root(struct btrfs_root *root, int del) ...@@ -1279,7 +1279,9 @@ static int __update_reloc_root(struct btrfs_root *root, int del)
if (rb_node) if (rb_node)
backref_tree_panic(rb_node, -EEXIST, node->bytenr); backref_tree_panic(rb_node, -EEXIST, node->bytenr);
} else { } else {
spin_lock(&root->fs_info->trans_lock);
list_del_init(&root->root_list); list_del_init(&root->root_list);
spin_unlock(&root->fs_info->trans_lock);
kfree(node); kfree(node);
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment