diff options
Diffstat (limited to 'fs/btrfs/dev-replace.c')
| -rw-r--r-- | fs/btrfs/dev-replace.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index 7ba7b3900cb8..4253ad580e39 100644 --- a/fs/btrfs/dev-replace.c +++ b/fs/btrfs/dev-replace.c | |||
| @@ -313,6 +313,11 @@ int btrfs_dev_replace_start(struct btrfs_root *root, | |||
| 313 | struct btrfs_device *tgt_device = NULL; | 313 | struct btrfs_device *tgt_device = NULL; |
| 314 | struct btrfs_device *src_device = NULL; | 314 | struct btrfs_device *src_device = NULL; |
| 315 | 315 | ||
| 316 | if (btrfs_fs_incompat(fs_info, RAID56)) { | ||
| 317 | pr_warn("btrfs: dev_replace cannot yet handle RAID5/RAID6\n"); | ||
| 318 | return -EINVAL; | ||
| 319 | } | ||
| 320 | |||
| 316 | switch (args->start.cont_reading_from_srcdev_mode) { | 321 | switch (args->start.cont_reading_from_srcdev_mode) { |
| 317 | case BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS: | 322 | case BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS: |
| 318 | case BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID: | 323 | case BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID: |
| @@ -395,7 +400,7 @@ int btrfs_dev_replace_start(struct btrfs_root *root, | |||
| 395 | args->result = BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR; | 400 | args->result = BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR; |
| 396 | btrfs_dev_replace_unlock(dev_replace); | 401 | btrfs_dev_replace_unlock(dev_replace); |
| 397 | 402 | ||
| 398 | btrfs_wait_ordered_extents(root, 0); | 403 | btrfs_wait_all_ordered_extents(root->fs_info, 0); |
| 399 | 404 | ||
| 400 | /* force writing the updated state information to disk */ | 405 | /* force writing the updated state information to disk */ |
| 401 | trans = btrfs_start_transaction(root, 0); | 406 | trans = btrfs_start_transaction(root, 0); |
| @@ -465,12 +470,12 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info, | |||
| 465 | * flush all outstanding I/O and inode extent mappings before the | 470 | * flush all outstanding I/O and inode extent mappings before the |
| 466 | * copy operation is declared as being finished | 471 | * copy operation is declared as being finished |
| 467 | */ | 472 | */ |
| 468 | ret = btrfs_start_delalloc_inodes(root, 0); | 473 | ret = btrfs_start_all_delalloc_inodes(root->fs_info, 0); |
| 469 | if (ret) { | 474 | if (ret) { |
| 470 | mutex_unlock(&dev_replace->lock_finishing_cancel_unmount); | 475 | mutex_unlock(&dev_replace->lock_finishing_cancel_unmount); |
| 471 | return ret; | 476 | return ret; |
| 472 | } | 477 | } |
| 473 | btrfs_wait_ordered_extents(root, 0); | 478 | btrfs_wait_all_ordered_extents(root->fs_info, 0); |
| 474 | 479 | ||
| 475 | trans = btrfs_start_transaction(root, 0); | 480 | trans = btrfs_start_transaction(root, 0); |
| 476 | if (IS_ERR(trans)) { | 481 | if (IS_ERR(trans)) { |
