summaryrefslogtreecommitdiffstats
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-07-06 11:46:04 +1000
committerNeilBrown <neilb@suse.de>2010-07-06 12:07:07 +1000
commit7d2e6486e34180215e4859c3b342246dfc6c07a0 (patch)
tree9ec3ec035088063fa72d2f148b5951fc9ddc9738 /mdadm.c
parenta4e13010df574a1ce597efe9cb15ed6d6003b8bb (diff)
downloadmdadm-7d2e6486e34180215e4859c3b342246dfc6c07a0.tar.gz
mdadm-7d2e6486e34180215e4859c3b342246dfc6c07a0.tar.xz
mdadm-7d2e6486e34180215e4859c3b342246dfc6c07a0.zip
Add --test option to --re-add and similar
--test can be given in Manage mode. This can be used when there is an attempt to fail or remove 'faulty', 'failed' or 'detached' devices, or to re-add 'missing' devices. If no devices were failed, removed, or re-added, then mdadm will exit with status '2'. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mdadm.c b/mdadm.c
index 770fdfd..9504af6 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -796,6 +796,9 @@ int main(int argc, char *argv[])
}
runstop = -1;
continue;
+ case O(MANAGE,'t'):
+ test = 1;
+ continue;
case O(MISC,'Q'):
case O(MISC,'D'):
@@ -1064,7 +1067,7 @@ int main(int argc, char *argv[])
rv = Manage_ro(devlist->devname, mdfd, readonly);
if (!rv && devs_found>1)
rv = Manage_subdevs(devlist->devname, mdfd,
- devlist->next, verbose-quiet);
+ devlist->next, verbose-quiet, test);
if (!rv && readonly < 0)
rv = Manage_ro(devlist->devname, mdfd, readonly);
if (!rv && runstop)