]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Incremental: allow --quiet to silence from errors from "-If"
authorNeilBrown <neilb@suse.de>
Tue, 28 May 2013 23:13:25 +0000 (09:13 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 28 May 2013 23:13:25 +0000 (09:13 +1000)
-q is currently ineffective on "mdadm -If".   Messages that are not
usage errors should be suppressed.

Signed-off-by: NeilBrown <neilb@suse.de>
Incremental.c

index 0a75e3431a08ab5f3465099169b1ef3a4e3e2b8d..f9c0feb9ebd4c882797899aad41b402d76837df5 100644 (file)
@@ -1611,8 +1611,9 @@ int IncrementalRemove(char *devname, char *id_path, int verbose)
        }
        ent = mdstat_by_component(devname);
        if (!ent) {
-               pr_err("%s does not appear to be a component "
-                       "of any array\n", devname);
+               if (verbose >= 0)
+                       pr_err("%s does not appear to be a component "
+                              "of any array\n", devname);
                return 1;
        }
        sysfs_init(&mdi, -1, ent->devnm);
@@ -1625,7 +1626,8 @@ int IncrementalRemove(char *devname, char *id_path, int verbose)
        }
        mdfd = open_dev(ent->devnm);
        if (mdfd < 0) {
-               pr_err("Cannot open array %s!!\n", ent->dev);
+               if (verbose >= 0)
+                       pr_err("Cannot open array %s!!\n", ent->dev);
                free_mdstat(ent);
                return 1;
        }