]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
md: Fix bug where spares don't always get rebuilt properly when they become live
authorNeil Brown <neilb@suse.de>
Mon, 26 Mar 2007 21:41:22 +0000 (23:41 +0200)
committerAdrian Bunk <bunk@stusta.de>
Mon, 26 Mar 2007 21:41:22 +0000 (23:41 +0200)
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: Adrian Bunk <bunk@stusta.de>
drivers/md/md.c

index 9957f583cb25191269377e845c7191b324bd512b..0471ebff482ffa4cf4c6df813fb5283c59813bdf 100644 (file)
@@ -1812,6 +1812,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;
        atomic_set(&rdev->nr_pending, 0);