]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: move btrfs_rm_dev_replace_free_srcdev outside of all locks
authorJosef Bacik <josef@toxicpanda.com>
Thu, 20 Aug 2020 15:18:27 +0000 (11:18 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:12:13 +0000 (12:12 +0200)
commit4fe11a2f7eba7ca403dcd15b1b8516a965610116
tree6bd938e94017d31c9d00f92ca839668103b6e826
parenta1cae626ddce4e55a9d773b3a978b490d924d0ce
btrfs: move btrfs_rm_dev_replace_free_srcdev outside of all locks

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 <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c