From 57ed8c9155d31ca78c48979f4f98d40e4c0deac3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 1 Oct 2008 18:50:44 -0700 Subject: [PATCH] Treat all devices at the container level as spares Raid disk and disk number information is not relevant at the container level, especially for imsm. So arrange for getinfo_super_imsm() to always publish devices as spares and report the number of spares at Assemble() time. Signed-off-by: Dan Williams --- Assemble.c | 2 +- super-intel.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Assemble.c b/Assemble.c index c691ec9..34f06a7 100644 --- a/Assemble.c +++ b/Assemble.c @@ -946,7 +946,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd, if (verbose >= 0) { fprintf(stderr, Name ": Container %s has been " "assembled with %d drive%s", - mddev, okcnt, okcnt==1?"":"s"); + mddev, okcnt+sparecnt, okcnt+sparecnt==1?"":"s"); if (okcnt < info.array.raid_disks) fprintf(stderr, " (out of %d)", info.array.raid_disks); diff --git a/super-intel.c b/super-intel.c index 7962ac3..a5b2d89 100644 --- a/super-intel.c +++ b/super-intel.c @@ -819,8 +819,6 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info) __u32 reserved = imsm_reserved_sectors(super, super->disks); disk = &super->disks->disk; - info->disk.number = super->disks->index; - info->disk.raid_disk = super->disks->index; info->data_offset = __le32_to_cpu(disk->total_blocks) - reserved; info->component_size = reserved; s = __le32_to_cpu(disk->status);