From: Anand Jain Date: Fri, 4 Sep 2020 17:34:31 +0000 (+0800) Subject: btrfs: use sprout device_list_mutex in btrfs_init_devices_late X-Git-Tag: v5.10-rc1~178^2~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e17125b52b7ec1075fae408e1a1da8005116e34a;p=thirdparty%2Fkernel%2Fstable.git btrfs: use sprout device_list_mutex in btrfs_init_devices_late On a mounted sprout filesystem, all threads now are using the sprout::device_list_mutex, and this is the only code using the seed::device_list_mutex. This patch converts to use the sprouts fs_info->fs_devices->device_list_mutex. The same reasoning holds true here, that device delete is holding the sprout::device_list_mutex. Signed-off-by: Anand Jain Signed-off-by: David Sterba --- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 79fe9822196f1..beacc779dbc2c 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -7195,16 +7195,14 @@ void btrfs_init_devices_late(struct btrfs_fs_info *fs_info) mutex_lock(&fs_devices->device_list_mutex); list_for_each_entry(device, &fs_devices->devices, dev_list) device->fs_info = fs_info; - mutex_unlock(&fs_devices->device_list_mutex); list_for_each_entry(seed_devs, &fs_devices->seed_list, seed_list) { - mutex_lock(&seed_devs->device_list_mutex); list_for_each_entry(device, &seed_devs->devices, dev_list) device->fs_info = fs_info; - mutex_unlock(&seed_devs->device_list_mutex); seed_devs->fs_info = fs_info; } + mutex_unlock(&fs_devices->device_list_mutex); } static u64 btrfs_dev_stats_value(const struct extent_buffer *eb,