Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20c5bbc6 authored by David Sterba's avatar David Sterba
Browse files

btrfs: restore uuid_mutex in btrfs_open_devices



Commit 542c5908 ("btrfs: replace uuid_mutex by
device_list_mutex in btrfs_open_devices") switched to device_list_mutex
as we need that for the device list traversal, but we also need
uuid_mutex to protect access to fs_devices::opened to be consistent with
other users of that.

Fixes: 542c5908 ("btrfs: replace uuid_mutex by device_list_mutex in btrfs_open_devices")
Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent e4e7ede7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1146,6 +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++;
@@ -1155,6 +1156,7 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
		ret = open_fs_devices(fs_devices, flags, holder);
	}
	mutex_unlock(&fs_devices->device_list_mutex);
	mutex_unlock(&uuid_mutex);

	return ret;
}