diff options
Diffstat (limited to 'fs/btrfs/dev-replace.c')
-rw-r--r-- | fs/btrfs/dev-replace.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index c523478b3de2..e279f04b3388 100644 --- a/fs/btrfs/dev-replace.c +++ b/fs/btrfs/dev-replace.c | |||
@@ -703,6 +703,7 @@ int btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info) | |||
703 | { | 703 | { |
704 | struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace; | 704 | struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace; |
705 | struct btrfs_device *tgt_device = NULL; | 705 | struct btrfs_device *tgt_device = NULL; |
706 | struct btrfs_device *src_device = NULL; | ||
706 | struct btrfs_trans_handle *trans; | 707 | struct btrfs_trans_handle *trans; |
707 | struct btrfs_root *root = fs_info->tree_root; | 708 | struct btrfs_root *root = fs_info->tree_root; |
708 | int result; | 709 | int result; |
@@ -724,6 +725,7 @@ int btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info) | |||
724 | case BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED: | 725 | case BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED: |
725 | result = BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR; | 726 | result = BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR; |
726 | tgt_device = dev_replace->tgtdev; | 727 | tgt_device = dev_replace->tgtdev; |
728 | src_device = dev_replace->srcdev; | ||
727 | dev_replace->tgtdev = NULL; | 729 | dev_replace->tgtdev = NULL; |
728 | dev_replace->srcdev = NULL; | 730 | dev_replace->srcdev = NULL; |
729 | break; | 731 | break; |
@@ -741,6 +743,12 @@ int btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info) | |||
741 | } | 743 | } |
742 | ret = btrfs_commit_transaction(trans); | 744 | ret = btrfs_commit_transaction(trans); |
743 | WARN_ON(ret); | 745 | WARN_ON(ret); |
746 | |||
747 | btrfs_info_in_rcu(fs_info, | ||
748 | "dev_replace from %s (devid %llu) to %s canceled", | ||
749 | btrfs_dev_name(src_device), src_device->devid, | ||
750 | btrfs_dev_name(tgt_device)); | ||
751 | |||
744 | if (tgt_device) | 752 | if (tgt_device) |
745 | btrfs_destroy_dev_replace_tgtdev(fs_info, tgt_device); | 753 | btrfs_destroy_dev_replace_tgtdev(fs_info, tgt_device); |
746 | 754 | ||