]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Don't list device= in --examine --scan output.
authorNeil Brown <neilb@suse.de>
Tue, 14 Jun 2005 06:34:23 +0000 (06:34 +0000)
committerNeil Brown <neilb@suse.de>
Tue, 14 Jun 2005 06:34:23 +0000 (06:34 +0000)
As the device list isn't stable, recording it should be avoided.
The device= list is still available if --verbose is given (once).

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
ChangeLog
Detail.c
Examine.c
mdadm.8
mdadm.c

index f4288e1f94b2dcc62ab8a9121d62bd08552bcef1..56ff63b49fa42acd0f11fb05df7c9c591fb66b00 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,10 @@ Changes Prior to this release
     -   Fix rounding errors in human_size()
     -   Fix silly example in mdadm.conf-examples
     -   When finding a /dev name for a device, prefer shorter names
+    -   Suppress listing of devices= in --brief output of -D or -E,
+       unless -v is given (-vv gives the old behaviour with -Dsv).
+       This is because the device list can change and so is not a
+       stable aspect of the array
        
 Changes Prior to 1.11.0 release
     -   Fix embarassing bug which causes --add to always fail.
index 370177a4e9586d4f902196da49bdf848e6118ded..46b483c4bd023cd9cf3d7073fa10b6231fb8b9c3 100644 (file)
--- a/Detail.c
+++ b/Detail.c
@@ -284,7 +284,7 @@ int Detail(char *dev, int brief, int test)
        if (super && brief && st)
                st->ss->brief_detail_super(super);
 
-       if (brief && devices) printf("\n   devices=%s", devices);
+       if (brief > 1 && devices) printf("\n   devices=%s", devices);
        if (brief) printf("\n");
        if (test && (rv&2)) rv &= ~1;
        close(fd);
index da859930b43be7864318df4db6d20eded5cfee81..8f15a759875dab1e8f504617840098b7d303f231 100644 (file)
--- a/Examine.c
+++ b/Examine.c
@@ -130,10 +130,12 @@ int Examine(mddev_dev_t devlist, int brief, int scan, int SparcAdjust, struct su
                        char *d;
                        ap->st->ss->brief_examine_super(ap->super);
                        if (ap->spares) printf("   spares=%d", ap->spares);
-                       printf("   devices");
-                       for (d=dl_next(ap->devs); d!= ap->devs; d=dl_next(d)) {
-                               printf("%c%s", sep, d);
-                               sep=',';
+                       if (brief > 1) {
+                               printf("   devices");
+                               for (d=dl_next(ap->devs); d!= ap->devs; d=dl_next(d)) {
+                                       printf("%c%s", sep, d);
+                                       sep=',';
+                               }
                        }
                        free(ap->super);
                        /* FIXME free ap */
diff --git a/mdadm.8 b/mdadm.8
index dfbb74c180457ba3b1634458a32cb454f30ea9ec..6836c4694fc12ba30ba1e31858c2843fa6fe2f36 100644 (file)
--- a/mdadm.8
+++ b/mdadm.8
@@ -185,7 +185,12 @@ Print version information for mdadm.
 
 .TP
 .BR -v ", " --verbose
-Be more verbose about what is happening.
+Be more verbose about what is happening.  This can be used twice to be
+extra-verbose.
+This currently only affects
+.B --detail --scan
+and
+.BR "--examine --scan" .
 
 .TP
 .BR -b ", " --brief
@@ -193,6 +198,11 @@ Be less verbose.  This is used with
 .B --detail
 and
 .BR --examine .
+Using
+.B --brief
+with
+.B --verbose
+gives an intermediate level of verbosity.
 
 .TP
 .BR -b ", " --bitmap=
diff --git a/mdadm.c b/mdadm.c
index 54c011e88e5d93dc74482a71a780bd2e998e10db..bc264b13f1caeec02e0f41268e87aa2670f10063 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -135,7 +135,7 @@ int main(int argc, char *argv[])
                        fputs(Version, stderr);
                        exit(0);
 
-               case 'v': verbose = 1;
+               case 'v': verbose++;
                        continue;
 
                case 'b':
@@ -939,7 +939,7 @@ int main(int argc, char *argv[])
                                fprintf(stderr, Name ": No devices listed in %s\n", configfile?configfile:DefaultConfFile);
                                exit(1);
                        }
-                       rv = Examine(devlist, scan?!verbose:brief, scan, SparcAdjust, ss);
+                       rv = Examine(devlist, scan?(verbose>1?0:verbose+1):brief, scan, SparcAdjust, ss);
                } else {
                        if (devlist == NULL) {
                                if (devmode=='D' && scan) {
@@ -954,7 +954,7 @@ int main(int argc, char *argv[])
                                                                e->dev);
                                                        continue;
                                                }
-                                               rv |= Detail(name, !verbose, test);
+                                               rv |= Detail(name, verbose>1?0:verbose+1, test);
                                                put_md_name(name);
                                        }
                                } else  if (devmode == 'S' && scan) {
@@ -998,7 +998,7 @@ int main(int argc, char *argv[])
                        for (dv=devlist ; dv; dv=dv->next) {
                                switch(dv->disposition) {
                                case 'D':
-                                       rv |= Detail(dv->devname, brief, test); continue;
+                                       rv |= Detail(dv->devname, brief?1+verbose:0, test); continue;
                                case 'K': /* Zero superblock */
                                        rv |= Kill(dv->devname, force); continue;
                                case 'Q':