Merge branch 'ext/anand/stale-devids-free' into for-next-stale-20190409
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index db934ce..7af1770 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1171,8 +1171,9 @@
{
struct btrfs_device *device, *next;
struct btrfs_device *latest_dev = NULL;
+ struct btrfs_fs_devices *parent_fs_devices = fs_devices;
- mutex_lock(&uuid_mutex);
+ mutex_lock(&parent_fs_devices->device_list_mutex);
again:
/* This is the initialized path, it is safe to release the devices. */
list_for_each_entry_safe(device, next, &fs_devices->devices, dev_list) {
@@ -1226,8 +1227,7 @@
}
fs_devices->latest_bdev = latest_dev->bdev;
-
- mutex_unlock(&uuid_mutex);
+ mutex_unlock(&parent_fs_devices->device_list_mutex);
}
static void free_device_rcu(struct rcu_head *head)