From: Adam Kwolek Date: Tue, 14 Jun 2011 02:42:06 +0000 (+1000) Subject: FIX: Cannot create volume X-Git-Tag: mdadm-3.2.2~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80e4abc99c7f5a16c56c1c4084bfad63aec03c01;p=thirdparty%2Fmdadm.git FIX: Cannot create volume getinfo_super() can clear entire 'inf' structure before filling with new information. Disk number required later is lost. Restore disk number information after getinfo_super() call. Signed-off-by: Adam Kwolek Signed-off-by: NeilBrown --- diff --git a/Create.c b/Create.c index 7b4d0fec..48115db8 100644 --- a/Create.c +++ b/Create.c @@ -856,11 +856,19 @@ int Create(struct supertype *st, char *mddev, /* getinfo_super might have lost these ... */ inf->disk.major = major(stb.st_rdev); inf->disk.minor = minor(stb.st_rdev); + /* FIXME the following should not be needed + * as getinfo_super is suppose to set + * them. However it doesn't for imsm, + * so we have this hack for now + */ + if (st->ss == &super_imsm) { + inf->disk.number = dnum; + inf->disk.raid_disk = dnum; + } } break; case 2: inf->errors = 0; - rv = 0; rv = add_disk(mdfd, st, &info, inf);