Skip to content

Commit

Permalink
btrfs: move btrfs_rm_dev_replace_free_srcdev outside of all locks
Browse files Browse the repository at this point in the history
When closing and freeing the source device we could end up doing our
final blkdev_put() on the bdev, which will grab the bd_mutex.  As such
we want to be holding as few locks as possible, so move this call
outside of the dev_replace->lock_finishing_cancel_unmount lock.  Since
we're modifying the fs_devices we need to make sure we're holding the
uuid_mutex here, so take that as well.

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
josefbacik authored and kdave committed Oct 7, 2020
1 parent 68abf36 commit 62cf539
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2216,7 +2216,6 @@ void btrfs_rm_dev_replace_remove_srcdev(struct btrfs_device *srcdev)

void btrfs_rm_dev_replace_free_srcdev(struct btrfs_device *srcdev)
{
struct btrfs_fs_info *fs_info = srcdev->fs_info;
struct btrfs_fs_devices *fs_devices = srcdev->fs_devices;

mutex_lock(&uuid_mutex);
Expand Down

0 comments on commit 62cf539

Please sign in to comment.