md: Fix raid1->raid0 takeover
authorKrzysztof Wojcik <krzysztof.wojcik@intel.com>
Sun, 13 Feb 2011 23:01:41 +0000 (10:01 +1100)
committerNeilBrown <neilb@suse.de>
Sun, 13 Feb 2011 23:01:41 +0000 (10:01 +1100)
Takeover raid1->raid0 not succeded. Kernel message is shown:
"md/raid0:md126: too few disks (1 of 2) - aborting!"

Problem was that we weren't updating ->raid_disks for that
takeover, unlike all the others.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid0.c

index 637a96855edb2b6c9c99e988fcdb78b696e703b2..75671dfee5511d08db786fc396f13cf5131b021d 100644 (file)
@@ -670,6 +670,7 @@ static void *raid0_takeover_raid1(mddev_t *mddev)
        mddev->new_layout = 0;
        mddev->new_chunk_sectors = 128; /* by default set chunk size to 64k */
        mddev->delta_disks = 1 - mddev->raid_disks;
+       mddev->raid_disks = 1;
        /* make sure it will be not marked as dirty */
        mddev->recovery_cp = MaxSector;