[PATCH] md: fix bug where spares don't always get rebuilt properly when they become...
authorNeilBrown <neilb@suse.de>
Sat, 28 Oct 2006 17:38:30 +0000 (10:38 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 28 Oct 2006 18:30:51 +0000 (11:30 -0700)
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 <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/md.c

index 7daa7b1e145f32d3736a48e7e9ee6e81f94c5bb8..c40ce9f9cc9bac881c4a737a7a85e05fd9e13897 100644 (file)
@@ -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;