Skip to content

Commit 7302fc0

Browse files
kdaveasj
authored andcommitted
btrfs: restore uuid_mutex in btrfs_open_devices
Commit 542c590 ("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 item. CC: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]> Reviewed-by: Anand Jain <[email protected]>
1 parent 4da8563 commit 7302fc0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/btrfs/volumes.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,7 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
11291129
{
11301130
int ret;
11311131

1132+
mutex_lock(&uuid_mutex);
11321133
mutex_lock(&fs_devices->device_list_mutex);
11331134
if (fs_devices->opened) {
11341135
fs_devices->opened++;
@@ -1138,6 +1139,7 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
11381139
ret = open_fs_devices(fs_devices, flags, holder);
11391140
}
11401141
mutex_unlock(&fs_devices->device_list_mutex);
1142+
mutex_unlock(&uuid_mutex);
11411143

11421144
return ret;
11431145
}

0 commit comments

Comments
 (0)