From: Krzysztof Wojcik Date: Sun, 13 Feb 2011 23:01:41 +0000 (+1100) Subject: md: Fix raid1->raid0 takeover X-Git-Tag: firefly_0821_release~7613^2~2367^2~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f7bee80945155ad0326916486dabc38428c6cdef;p=firefly-linux-kernel-4.4.55.git md: Fix raid1->raid0 takeover 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 Signed-off-by: NeilBrown --- diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 637a96855edb..75671dfee551 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -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;