diff options
author | Anand Jain <anand.jain@oracle.com> | 2018-04-12 04:29:34 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-05-28 18:23:15 +0200 |
commit | 542c5908abfe84f7b4c1717492ecc92ea0ea328d (patch) | |
tree | 3b94ce4b3adba78f045f537067e5355b7ac4ad4d /fs/btrfs/volumes.c | |
parent | btrfs: document uuid_mutex uasge in read_chunk_tree (diff) | |
download | linux-542c5908abfe84f7b4c1717492ecc92ea0ea328d.tar.xz linux-542c5908abfe84f7b4c1717492ecc92ea0ea328d.zip |
btrfs: replace uuid_mutex by device_list_mutex in btrfs_open_devices
btrfs_open_devices() is using the uuid_mutex, but as btrfs_open_devices
is just limited to openning all the devices under for given fsid, so we
don't need uuid_mutex.
Instead it should hold the device_list_mutex as it updates the members
of the btrfs_fs_devices and btrfs_device and not the whole fs_devs list.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ update changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 6eec1e3f9083..271d9be6e1da 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1146,7 +1146,7 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, { int ret; - mutex_lock(&uuid_mutex); + mutex_lock(&fs_devices->device_list_mutex); if (fs_devices->opened) { fs_devices->opened++; ret = 0; @@ -1154,7 +1154,8 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, list_sort(NULL, &fs_devices->devices, devid_cmp); ret = open_fs_devices(fs_devices, flags, holder); } - mutex_unlock(&uuid_mutex); + mutex_unlock(&fs_devices->device_list_mutex); + return ret; } |