From d30519fc59c5cc2f7772fa67b16b1a2426d36c95 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 18 Oct 2011 12:13:47 +1100 Subject: [PATCH] md: clear In_sync bit on devices added to an active array. When we add a device to an active array it can be meaningful to set the 'insync' flag. This indicates that the device is in-sync with the array except for locations recorded in the bitmap. A bitmap-based recovery can then bring it completely in-sync. Internally we move that flag to 'saved_raid_disk' but forgot to clear In_sync like we do in add_new_disk. So clear In_sync after moving its value to saved_raid_disk. Reported-by: Andrei Warkentin Signed-off-by: NeilBrown --- drivers/md/md.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/md.c b/drivers/md/md.c index 7a491771ff4d..0ea34858637a 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -2722,6 +2722,7 @@ slot_store(struct md_rdev *rdev, const char *buf, size_t len) rdev->saved_raid_disk = slot; else rdev->saved_raid_disk = -1; + clear_bit(In_sync, &rdev->flags); err = rdev->mddev->pers-> hot_add_disk(rdev->mddev, rdev); if (err) { -- 2.11.4.GIT