diff options
author | NeilBrown <neilb@suse.de> | 2014-01-13 23:55:14 -0500 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2014-01-14 00:44:21 -0500 |
commit | 7eb418851f3278de67126ea0c427641ab4792c57 (patch) | |
tree | 6faa679f307ec0d333765bc87baa50021ebd9959 /drivers/md/md.c | |
parent | f466722ca614edcd14f3337373f33132117c7612 (diff) |
md: allow a partially recovered device to be hot-added to an array.
When adding a new device into an array it is normally important to
clear any stale data from ->recovery_offset else the new device may
not be recovered properly.
However when re-adding a device which is known to be nearly in-sync,
this is not needed and can be detrimental. The (bitmap-based)
resync will still happen, and further recovery is only needed from
where-ever it was already up to.
So if save_raid_disk is set, signifying a re-add, don't clear
->recovery_offset.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 539f08885e7f..757e388308a8 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -7736,7 +7736,8 @@ static int remove_and_add_spares(struct mddev *mddev, | |||
7736 | !test_bit(Bitmap_sync, &rdev->flags))) | 7736 | !test_bit(Bitmap_sync, &rdev->flags))) |
7737 | continue; | 7737 | continue; |
7738 | 7738 | ||
7739 | rdev->recovery_offset = 0; | 7739 | if (rdev->saved_raid_disk < 0) |
7740 | rdev->recovery_offset = 0; | ||
7740 | if (mddev->pers-> | 7741 | if (mddev->pers-> |
7741 | hot_add_disk(mddev, rdev) == 0) { | 7742 | hot_add_disk(mddev, rdev) == 0) { |
7742 | if (sysfs_link_rdev(mddev, rdev)) | 7743 | if (sysfs_link_rdev(mddev, rdev)) |