Skip to content

Commit d01552a

Browse files
author
NeilBrown
committed
Revert "md: allow a partially recovered device to be hot-added to an array."
This reverts commit 7eb4188. This commit is poorly justified, I can find not discusison in email, and it clearly causes a problem. If a device which is being recovered fails and is subsequently re-added to an array, there could easily have been changes to the array *before* the point where the recovery was up to. So the recovery must start again from the beginning. If a spare is being recovered and fails, then when it is re-added we really should do a bitmap-based recovery up to the recovery-offset, and then a full recovery from there. Before this reversion, we only did the "full recovery from there" which is not corect. After this reversion with will do a full recovery from the start, which is safer but not ideal. It will be left to a future patch to arrange the two different styles of recovery. Reported-and-tested-by: Nate Dailey <nate.dailey@stratus.com> Signed-off-by: NeilBrown <neilb@suse.com> Cc: stable@vger.kernel.org (3.14+) Fixes: 7eb4188 ("md: allow a partially recovered device to be hot-added to an array.")
1 parent b8a9d66 commit d01552a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/md/md.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8040,8 +8040,7 @@ static int remove_and_add_spares(struct mddev *mddev,
80408040
!test_bit(Bitmap_sync, &rdev->flags)))
80418041
continue;
80428042

8043-
if (rdev->saved_raid_disk < 0)
8044-
rdev->recovery_offset = 0;
8043+
rdev->recovery_offset = 0;
80458044
if (mddev->pers->
80468045
hot_add_disk(mddev, rdev) == 0) {
80478046
if (sysfs_link_rdev(mddev, rdev))

0 commit comments

Comments
 (0)