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,
558558 struct btrfs_device * device , * tmp_device ;
559559 int ret = 0 ;
560560
561+ lockdep_assert_held (& uuid_mutex );
562+
561563 if (path )
562564 ret = - ENOENT ;
563565
@@ -988,11 +990,12 @@ static struct btrfs_fs_devices *clone_fs_devices(struct btrfs_fs_devices *orig)
988990 struct btrfs_device * orig_dev ;
989991 int ret = 0 ;
990992
993+ lockdep_assert_held (& uuid_mutex );
994+
991995 fs_devices = alloc_fs_devices (orig -> fsid , NULL );
992996 if (IS_ERR (fs_devices ))
993997 return fs_devices ;
994998
995- mutex_lock (& orig -> device_list_mutex );
996999 fs_devices -> total_devices = orig -> total_devices ;
9971000
9981001 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)
10241027 device -> fs_devices = fs_devices ;
10251028 fs_devices -> num_devices ++ ;
10261029 }
1027- mutex_unlock (& orig -> device_list_mutex );
10281030 return fs_devices ;
10291031error :
1030- mutex_unlock (& orig -> device_list_mutex );
10311032 free_fs_devices (fs_devices );
10321033 return ERR_PTR (ret );
10331034}
You can’t perform that action at this time.
0 commit comments