diff options
Diffstat (limited to 'fs/btrfs/dev-replace.c')
-rw-r--r-- | fs/btrfs/dev-replace.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index 564c92638b20..b20d59e5e5dd 100644 --- a/fs/btrfs/dev-replace.c +++ b/fs/btrfs/dev-replace.c | |||
@@ -484,6 +484,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info, | |||
484 | WARN_ON(ret); | 484 | WARN_ON(ret); |
485 | 485 | ||
486 | /* keep away write_all_supers() during the finishing procedure */ | 486 | /* keep away write_all_supers() during the finishing procedure */ |
487 | mutex_lock(&root->fs_info->chunk_mutex); | ||
487 | mutex_lock(&root->fs_info->fs_devices->device_list_mutex); | 488 | mutex_lock(&root->fs_info->fs_devices->device_list_mutex); |
488 | btrfs_dev_replace_lock(dev_replace); | 489 | btrfs_dev_replace_lock(dev_replace); |
489 | dev_replace->replace_state = | 490 | dev_replace->replace_state = |
@@ -503,6 +504,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info, | |||
503 | rcu_str_deref(tgt_device->name), scrub_ret); | 504 | rcu_str_deref(tgt_device->name), scrub_ret); |
504 | btrfs_dev_replace_unlock(dev_replace); | 505 | btrfs_dev_replace_unlock(dev_replace); |
505 | mutex_unlock(&root->fs_info->fs_devices->device_list_mutex); | 506 | mutex_unlock(&root->fs_info->fs_devices->device_list_mutex); |
507 | mutex_unlock(&root->fs_info->chunk_mutex); | ||
506 | if (tgt_device) | 508 | if (tgt_device) |
507 | btrfs_destroy_dev_replace_tgtdev(fs_info, tgt_device); | 509 | btrfs_destroy_dev_replace_tgtdev(fs_info, tgt_device); |
508 | mutex_unlock(&dev_replace->lock_finishing_cancel_unmount); | 510 | mutex_unlock(&dev_replace->lock_finishing_cancel_unmount); |
@@ -543,6 +545,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info, | |||
543 | */ | 545 | */ |
544 | btrfs_dev_replace_unlock(dev_replace); | 546 | btrfs_dev_replace_unlock(dev_replace); |
545 | mutex_unlock(&root->fs_info->fs_devices->device_list_mutex); | 547 | mutex_unlock(&root->fs_info->fs_devices->device_list_mutex); |
548 | mutex_unlock(&root->fs_info->chunk_mutex); | ||
546 | 549 | ||
547 | /* write back the superblocks */ | 550 | /* write back the superblocks */ |
548 | trans = btrfs_start_transaction(root, 0); | 551 | trans = btrfs_start_transaction(root, 0); |