File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -558,6 +558,8 @@ static int btrfs_free_stale_devices(const char *path,
558
558
struct btrfs_device * device , * tmp_device ;
559
559
int ret = 0 ;
560
560
561
+ lockdep_assert_held (& uuid_mutex );
562
+
561
563
if (path )
562
564
ret = - ENOENT ;
563
565
@@ -988,11 +990,12 @@ static struct btrfs_fs_devices *clone_fs_devices(struct btrfs_fs_devices *orig)
988
990
struct btrfs_device * orig_dev ;
989
991
int ret = 0 ;
990
992
993
+ lockdep_assert_held (& uuid_mutex );
994
+
991
995
fs_devices = alloc_fs_devices (orig -> fsid , NULL );
992
996
if (IS_ERR (fs_devices ))
993
997
return fs_devices ;
994
998
995
- mutex_lock (& orig -> device_list_mutex );
996
999
fs_devices -> total_devices = orig -> total_devices ;
997
1000
998
1001
list_for_each_entry (orig_dev , & orig -> devices , dev_list ) {
@@ -1024,10 +1027,8 @@ static struct btrfs_fs_devices *clone_fs_devices(struct btrfs_fs_devices *orig)
1024
1027
device -> fs_devices = fs_devices ;
1025
1028
fs_devices -> num_devices ++ ;
1026
1029
}
1027
- mutex_unlock (& orig -> device_list_mutex );
1028
1030
return fs_devices ;
1029
1031
error :
1030
- mutex_unlock (& orig -> device_list_mutex );
1031
1032
free_fs_devices (fs_devices );
1032
1033
return ERR_PTR (ret );
1033
1034
}
You can’t perform that action at this time.
0 commit comments