diff options
author | Daniel J Blueman <daniel@quora.org> | 2012-04-27 12:41:46 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2012-04-27 13:55:13 -0400 |
commit | 1daf3540fa77faea2f91d96bcaf07ce48ee827be (patch) | |
tree | 0cdec92cca58085352b7ba8f4c3245a91dd0b5a9 /fs | |
parent | 3e74317ad773ba9df36db1fa32848cba41ac4d1a (diff) |
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 <daniel@quora.org>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/relocation.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 017281dbb2a7..5a105a086acf 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) | |||
1279 | if (rb_node) | 1279 | if (rb_node) |
1280 | backref_tree_panic(rb_node, -EEXIST, node->bytenr); | 1280 | backref_tree_panic(rb_node, -EEXIST, node->bytenr); |
1281 | } else { | 1281 | } else { |
1282 | spin_lock(&root->fs_info->trans_lock); | ||
1282 | list_del_init(&root->root_list); | 1283 | list_del_init(&root->root_list); |
1284 | spin_unlock(&root->fs_info->trans_lock); | ||
1283 | kfree(node); | 1285 | kfree(node); |
1284 | } | 1286 | } |
1285 | return 0; | 1287 | return 0; |