@@ -934,8 +934,9 @@ void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step)
{
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) {
@@ -989,8 +990,7 @@ void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step)
}
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)