summaryrefslogtreecommitdiffstats
path: root/Examine.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2003-10-29 00:20:01 +0100
committerNeil Brown <neilb@suse.de>2003-10-29 00:20:01 +0100
commitfeb716e9c3568a45b8815bf2c59e417d30635f89 (patch)
tree0f8e3d3ad2ba688cf70c7655e86566a5fa27e753 /Examine.c
parentmdadm-1.3.0 (diff)
downloadmdadm-feb716e9c3568a45b8815bf2c59e417d30635f89.tar.xz
mdadm-feb716e9c3568a45b8815bf2c59e417d30635f89.zip
mdadm-1.4.0mdadm-1.4.0
Diffstat (limited to 'Examine.c')
-rw-r--r--Examine.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Examine.c b/Examine.c
index 6263866e..983f90a6 100644
--- a/Examine.c
+++ b/Examine.c
@@ -60,6 +60,7 @@ int Examine(mddev_dev_t devlist, int brief, int scan, int SparcAdjust)
char *c;
int rv = 0;
int err;
+ int spares = 0;
struct array {
mdp_super_t super;
@@ -205,7 +206,7 @@ int Examine(mddev_dev_t devlist, int brief, int scan, int SparcAdjust)
if (dp->state & (1<<MD_DISK_ACTIVE)) printf(" active");
if (dp->state & (1<<MD_DISK_SYNC)) printf(" sync");
if (dp->state & (1<<MD_DISK_REMOVED)) printf(" removed");
- if (dp->state == 0) printf(" spare");
+ if (dp->state == 0) { printf(" spare"); spares++; }
if ((dv=map_dev(dp->major, dp->minor)))
printf(" %s", dv);
printf("\n");
@@ -237,6 +238,7 @@ int Examine(mddev_dev_t devlist, int brief, int scan, int SparcAdjust)
char *d;
printf("ARRAY /dev/md%d level=%s num-devices=%d UUID=",
ap->super.md_minor, c?c:"-unknown-", ap->super.raid_disks);
+ if (spares) printf(" spares=%d", spares);
if (ap->super.minor_version >= 90)
printf("%08x:%08x:%08x:%08x", ap->super.set_uuid0, ap->super.set_uuid1,
ap->super.set_uuid2, ap->super.set_uuid3);