From: NeilBrown Date: Sat, 28 Oct 2006 17:38:30 +0000 (-0700) Subject: [PATCH] md: fix bug where spares don't always get rebuilt properly when they become... X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2b6e845986347ef86729e8651908af3e8a8441f5;p=linux-beck.git [PATCH] md: fix bug where spares don't always get rebuilt properly when they become live If save_raid_disk is >= 0, then the device could be a device that is already in sync that is being re-added. So we need to default this value to -1. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/md.c b/drivers/md/md.c index 7daa7b1e145f..c40ce9f9cc9b 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -2003,6 +2003,7 @@ static mdk_rdev_t *md_import_device(dev_t newdev, int super_format, int super_mi kobject_init(&rdev->kobj); rdev->desc_nr = -1; + rdev->saved_raid_disk = -1; rdev->flags = 0; rdev->data_offset = 0; rdev->sb_events = 0;