]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] md: Clear clevel whenever level is set.
authorNeilBrown <neilb@suse.de>
Tue, 17 Jan 2006 06:14:57 +0000 (22:14 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 17 Jan 2006 07:15:32 +0000 (23:15 -0800)
The 'level' of an md array can be set as either a number of a string.  When
one is set, the other must be marked 'undefined'.  This wasn't being done
in one place: where new arrays are created.

Result: if md1 is a raid1, it is stopped and a raid5 is created there, it
might still appear to be a raid1.

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 1778104e106cf4b331b44e09da51dd02aaf415fc..7145cd150f7b2cac4f00c40f9efef5a36b5fad15 100644 (file)
@@ -3395,6 +3395,7 @@ static int set_array_info(mddev_t * mddev, mdu_array_info_t *info)
        mddev->ctime         = get_seconds();
 
        mddev->level         = info->level;
+       mddev->clevel[0]     = 0;
        mddev->size          = info->size;
        mddev->raid_disks    = info->raid_disks;
        /* don't set md_minor, it is determined by which /dev/md* was