]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Examine.c
mdadm-1.5.0
[thirdparty/mdadm.git] / Examine.c
index 0270108924355a98ebdc330b814a6e6fffc18a66..2dd76b5ff550693886ff0197b910fc9129364bd9 100644 (file)
--- 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;
@@ -161,7 +162,7 @@ int Examine(mddev_dev_t devlist, int brief, int scan, int SparcAdjust)
                        if (calc_sb_csum(&super) == super.sb_csum)
                                printf("       Checksum : %x - correct\n", super.sb_csum);
                        else
-                               printf("       Checksum : %x - expected %x\n", super.sb_csum, calc_sb_csum(&super));
+                               printf("       Checksum : %x - expected %lx\n", super.sb_csum, calc_sb_csum(&super));
                        if (SparcAdjust) {
                                /* 2.2 sparc put the events in the wrong place
                                 * So we copy the tail of the superblock
@@ -205,6 +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"); spares++; }
                                if ((dv=map_dev(dp->major, dp->minor)))
                                        printf("   %s", dv);
                                printf("\n");
@@ -236,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);