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 <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Adam Kwolek 2011-06-14 12:42:06 +10:00 committed by NeilBrown
parent 0de8d44dde
commit 80e4abc99c
1 changed files with 9 additions and 1 deletions

View File

@ -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);