diff options
| author | Anand Jain <[email protected]> | 2021-11-09 09:51:58 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2022-01-03 14:09:44 +0000 |
| commit | 849eae5e57a703105aa6cdce0d860ab95f44d81c (patch) | |
| tree | 326390a0588a30974bf3717fe22cf6a732eaacf1 /fs/btrfs/dev-replace.c | |
| parent | btrfs: switch seeding_dev in init_new_device to bool (diff) | |
| download | kernel-849eae5e57a703105aa6cdce0d860ab95f44d81c.tar.gz kernel-849eae5e57a703105aa6cdce0d860ab95f44d81c.zip | |
btrfs: consolidate device_list_mutex in prepare_sprout to its parent
btrfs_prepare_sprout() splices seed devices into its own struct fs_devices,
so that its parent function btrfs_init_new_device() can add the new sprout
device to fs_info->fs_devices.
Both btrfs_prepare_sprout() and btrfs_init_new_device() need
device_list_mutex. But they are holding it separately, thus create a
small race window. Close it and hold device_list_mutex across both
functions btrfs_init_new_device() and btrfs_prepare_sprout().
Split btrfs_prepare_sprout() into btrfs_init_sprout() and
btrfs_setup_sprout(). This split is essential because device_list_mutex
must not be held for allocations in btrfs_init_sprout() but must be held
for btrfs_setup_sprout(). So now a common device_list_mutex can be used
between btrfs_init_new_device() and btrfs_setup_sprout().
Reviewed-by: Josef Bacik <[email protected]>
Signed-off-by: Anand Jain <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions
