]> 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 00:14:31 +0000 (00:14 +0000)
committerNeil Brown <neilb@suse.de>
Tue, 14 Jun 2005 00:14:31 +0000 (00:14 +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 2d4b709133376715bdaefdbcd688a2551f2285ab..95efebe8b1afe17f06bd1f9bcb96c5360b297774 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,10 @@ Changes Prior to 1.12.0 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 7555a9ace5d4e5682802672e43dc8af226230397..e0391f9f438dee41ab152fdd534a7cb5c5a88dc6 100644 (file)
--- a/Detail.c
+++ b/Detail.c
@@ -286,7 +286,7 @@ int Detail(char *dev, int brief, int test)
                else
                        printf("%08x", super.set_uuid0);
        }
-       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 79537fa736eca0c6d498a9959b123caf35cf9281..186b6b14a72fb483c1220815d8a56d07bf517597 100644 (file)
--- a/Examine.c
+++ b/Examine.c
@@ -255,10 +255,12 @@ int Examine(mddev_dev_t devlist, int brief, int scan, int SparcAdjust)
                                       ap->super.set_uuid2, ap->super.set_uuid3);
                        else
                                printf("%08x", ap->super.set_uuid0);
-                       printf("\n   devices");
-                       for (d=dl_next(ap->devs); d!= ap->devs; d=dl_next(d)) {
-                               printf("%c%s", sep, d);
-                               sep=',';
+                       if (brief > 1) {
+                               printf("\n   devices");
+                               for (d=dl_next(ap->devs); d!= ap->devs; d=dl_next(d)) {
+                                       printf("%c%s", sep, d);
+                                       sep=',';
+                               }
                        }
                        printf("\n");
                }
diff --git a/mdadm.8 b/mdadm.8
index 13e1bfa558aedd1134a5a3441e88753cf22b2441..72c01743a525fa8fef113684ca901c1976a231f4 100644 (file)
--- a/mdadm.8
+++ b/mdadm.8
@@ -181,7 +181,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
@@ -189,6 +194,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 -f ", " --force
diff --git a/mdadm.c b/mdadm.c
index 19ca9986491bdd13cfea488eb13bbc185c65537c..2ebc1e4cb05d071e7efac1582f63cd96fdcb4b83 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -123,7 +123,7 @@ int main(int argc, char *argv[])
                        fputs(Version, stderr);
                        exit(0);
 
-               case 'v': verbose = 1;
+               case 'v': verbose++;
                        continue;
 
                case 'b': brief = 1;
@@ -818,7 +818,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);
+                       rv = Examine(devlist, scan?(verbose>1?0:verbose+1):brief, scan, SparcAdjust);
                } else {
                        if (devlist == NULL) {
                                if (devmode=='D' && scan) {
@@ -833,7 +833,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) {
@@ -877,7 +877,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':