diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-05-27 10:03:58 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-05-27 10:03:58 -0400 |
commit | 174ba50915b08dcfd07c8b5fb795b46a165fa09a (patch) | |
tree | 94bc84b6e8bea05775373f90bd8eb7aa254a943f /fs/btrfs/disk-io.c | |
parent | a47d6b70e280401d553e7cac6f5750870de1ad21 (diff) | |
download | linux-3.10-174ba50915b08dcfd07c8b5fb795b46a165fa09a.tar.gz linux-3.10-174ba50915b08dcfd07c8b5fb795b46a165fa09a.tar.bz2 linux-3.10-174ba50915b08dcfd07c8b5fb795b46a165fa09a.zip |
Btrfs: use the device_list_mutex during write_dev_supers
write_dev_supers was changed to use RCU to protect the list of
devices, but it was then sleeping while it actually wrote the supers.
This fixes it to just use the mutex, since we really don't any
concurrency in write_dev_supers anyway.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index b2588a55265..98b6a71decb 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2310,7 +2310,7 @@ int write_all_supers(struct btrfs_root *root, int max_mirrors) sb = &root->fs_info->super_for_commit; dev_item = &sb->dev_item; - rcu_read_lock(); + mutex_lock(&root->fs_info->fs_devices->device_list_mutex); head = &root->fs_info->fs_devices->devices; list_for_each_entry_rcu(dev, head, dev_list) { if (!dev->bdev) { @@ -2355,7 +2355,7 @@ int write_all_supers(struct btrfs_root *root, int max_mirrors) if (ret) total_errors++; } - rcu_read_unlock(); + mutex_unlock(&root->fs_info->fs_devices->device_list_mutex); if (total_errors > max_errors) { printk(KERN_ERR "btrfs: %d errors while writing supers\n", total_errors); |