diff options
Diffstat (limited to 'fs/btrfs/dev-replace.c')
| -rw-r--r-- | fs/btrfs/dev-replace.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index 9f2290509aca..eea26e1b2fda 100644 --- a/fs/btrfs/dev-replace.c +++ b/fs/btrfs/dev-replace.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include "check-integrity.h" | 36 | #include "check-integrity.h" |
| 37 | #include "rcu-string.h" | 37 | #include "rcu-string.h" |
| 38 | #include "dev-replace.h" | 38 | #include "dev-replace.h" |
| 39 | #include "sysfs.h" | ||
| 39 | 40 | ||
| 40 | static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info, | 41 | static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info, |
| 41 | int scrub_ret); | 42 | int scrub_ret); |
| @@ -313,7 +314,7 @@ int btrfs_dev_replace_start(struct btrfs_root *root, | |||
| 313 | 314 | ||
| 314 | if (btrfs_fs_incompat(fs_info, RAID56)) { | 315 | if (btrfs_fs_incompat(fs_info, RAID56)) { |
| 315 | btrfs_warn(fs_info, "dev_replace cannot yet handle RAID5/RAID6"); | 316 | btrfs_warn(fs_info, "dev_replace cannot yet handle RAID5/RAID6"); |
| 316 | return -EINVAL; | 317 | return -EOPNOTSUPP; |
| 317 | } | 318 | } |
| 318 | 319 | ||
| 319 | switch (args->start.cont_reading_from_srcdev_mode) { | 320 | switch (args->start.cont_reading_from_srcdev_mode) { |
| @@ -562,6 +563,10 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info, | |||
| 562 | fs_info->fs_devices->latest_bdev = tgt_device->bdev; | 563 | fs_info->fs_devices->latest_bdev = tgt_device->bdev; |
| 563 | list_add(&tgt_device->dev_alloc_list, &fs_info->fs_devices->alloc_list); | 564 | list_add(&tgt_device->dev_alloc_list, &fs_info->fs_devices->alloc_list); |
| 564 | 565 | ||
| 566 | /* replace the sysfs entry */ | ||
| 567 | btrfs_kobj_rm_device(fs_info, src_device); | ||
| 568 | btrfs_kobj_add_device(fs_info, tgt_device); | ||
| 569 | |||
| 565 | btrfs_rm_dev_replace_blocked(fs_info); | 570 | btrfs_rm_dev_replace_blocked(fs_info); |
| 566 | 571 | ||
| 567 | btrfs_rm_dev_replace_srcdev(fs_info, src_device); | 572 | btrfs_rm_dev_replace_srcdev(fs_info, src_device); |
