Explorar el Código

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>
Daniel J Blueman hace 13 años
padre
commit
1daf3540fa
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      fs/btrfs/relocation.c

+ 2 - 0
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;