File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -570,6 +570,8 @@ static int btrfs_free_stale_devices(const char *path,
570
570
struct btrfs_device * device , * tmp_device ;
571
571
int ret = 0 ;
572
572
573
+ lockdep_assert_held (& uuid_mutex );
574
+
573
575
if (path )
574
576
ret = - ENOENT ;
575
577
@@ -1004,11 +1006,12 @@ static struct btrfs_fs_devices *clone_fs_devices(struct btrfs_fs_devices *orig)
1004
1006
struct btrfs_device * orig_dev ;
1005
1007
int ret = 0 ;
1006
1008
1009
+ lockdep_assert_held (& uuid_mutex );
1010
+
1007
1011
fs_devices = alloc_fs_devices (orig -> fsid , NULL );
1008
1012
if (IS_ERR (fs_devices ))
1009
1013
return fs_devices ;
1010
1014
1011
- mutex_lock (& orig -> device_list_mutex );
1012
1015
fs_devices -> total_devices = orig -> total_devices ;
1013
1016
1014
1017
list_for_each_entry (orig_dev , & orig -> devices , dev_list ) {
@@ -1040,10 +1043,8 @@ static struct btrfs_fs_devices *clone_fs_devices(struct btrfs_fs_devices *orig)
1040
1043
device -> fs_devices = fs_devices ;
1041
1044
fs_devices -> num_devices ++ ;
1042
1045
}
1043
- mutex_unlock (& orig -> device_list_mutex );
1044
1046
return fs_devices ;
1045
1047
error :
1046
- mutex_unlock (& orig -> device_list_mutex );
1047
1048
free_fs_devices (fs_devices );
1048
1049
return ERR_PTR (ret );
1049
1050
}
You can’t perform that action at this time.
0 commit comments