Skip to contentSkip to conversation

md: Clear clevel whenever level is set.

PATCH New NeilBrown 1 participant 1 message Jan 17, 2006 1 message not in the archive MD RAID

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20060117164838.14832.patches@notabene

NeilBrown

author
#1 lore raw

PATCH 1/1 md: Clear clevel whenever level is set.

This patch fixes a little bug in 2.6.15-mm3
--

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.

### Diffstat output

 ./drivers/md/md.c |    1 +
 1 file changed, 1 insertion(+)
drivers/md/md.c renamed from drivers/md/md.c~current~ +1 -0
diff ./drivers/md/md.c~current~ ./drivers/md/md.c
@@ -3392,6 +3392,7 @@ static int set_array_info(mddev_t * mdde
 	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