Message ID | 20180522092929.12014-1-anand.jain@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, May 22, 2018 at 05:29:29PM +0800, Anand Jain wrote: > btrfs_free_extra_devids() frees the orphan fsid::devid with in > btrfs_fs_devices::devices, so we dont need uuid_mutex, instead hold the > btrfs_fs_devices::device_list_mutex. This still lacks the reason why, the text merely repeats what the code change does. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 2b101dc49d91..b1e5ac419ca8 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -925,7 +925,7 @@ void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step) struct btrfs_device *device, *next; struct btrfs_device *latest_dev = NULL; - mutex_lock(&uuid_mutex); + mutex_lock(&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) { @@ -979,8 +979,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(&fs_devices->device_list_mutex); } static void free_device_rcu(struct rcu_head *head)
btrfs_free_extra_devids() frees the orphan fsid::devid with in btrfs_fs_devices::devices, so we dont need uuid_mutex, instead hold the btrfs_fs_devices::device_list_mutex. Signed-off-by: Anand Jain <anand.jain@oracle.com> --- v1->v2: replace uuid_mutex with device_list_mutex instead of delete. change log updated. fs/btrfs/volumes.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)