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 @@ -570,6 +570,8 @@ static int btrfs_free_stale_devices(const char *path,
570570 struct btrfs_device * device , * tmp_device ;
571571 int ret = 0 ;
572572
573+ lockdep_assert_held (& uuid_mutex );
574+
573575 if (path )
574576 ret = - ENOENT ;
575577
@@ -1004,11 +1006,12 @@ static struct btrfs_fs_devices *clone_fs_devices(struct btrfs_fs_devices *orig)
10041006 struct btrfs_device * orig_dev ;
10051007 int ret = 0 ;
10061008
1009+ lockdep_assert_held (& uuid_mutex );
1010+
10071011 fs_devices = alloc_fs_devices (orig -> fsid , NULL );
10081012 if (IS_ERR (fs_devices ))
10091013 return fs_devices ;
10101014
1011- mutex_lock (& orig -> device_list_mutex );
10121015 fs_devices -> total_devices = orig -> total_devices ;
10131016
10141017 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)
10401043 device -> fs_devices = fs_devices ;
10411044 fs_devices -> num_devices ++ ;
10421045 }
1043- mutex_unlock (& orig -> device_list_mutex );
10441046 return fs_devices ;
10451047error :
1046- mutex_unlock (& orig -> device_list_mutex );
10471048 free_fs_devices (fs_devices );
10481049 return ERR_PTR (ret );
10491050}
You can’t perform that action at this time.
0 commit comments