diff options
author | NeilBrown <neilb@suse.de> | 2010-04-09 09:18:53 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-04-09 09:19:19 +1000 |
commit | 0f9ce65ed03f69c50ca506c2ef68d739db722971 (patch) | |
tree | 2f16c2b6d64b0857e6b31b5f44ac42f45ca8622f /mdadm.c | |
parent | 7a5090d2247936d7cf7d9067c960317ad009940d (diff) | |
download | mdadm-0f9ce65ed03f69c50ca506c2ef68d739db722971.tar.gz mdadm-0f9ce65ed03f69c50ca506c2ef68d739db722971.tar.xz mdadm-0f9ce65ed03f69c50ca506c2ef68d739db722971.zip |
Add -fail support to --incremental
This can be used for hot-unplug. When a device has been remove,
udev can call
mdadm --incremental --fail sda
and mdadm will find the array holding sda and remove sda from
the array.
Based on code from Doug Ledford <dledford@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r-- | mdadm.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -774,6 +774,9 @@ int main(int argc, char *argv[]) devmode = 'r'; continue; case O(MANAGE,'f'): /* set faulty */ + case O(INCREMENTAL,'f'): /* r for incremental is taken, use f + * even though we will both fail and + * remove the device */ devmode = 'f'; continue; case O(INCREMENTAL,'R'): @@ -1517,6 +1520,11 @@ int main(int argc, char *argv[]) ": --incremental --scan meaningless without --run.\n"); break; } + if (devmode == 'f') { + fprintf(stderr, Name + ": --incremental --scan --fail not supported.\n"); + break; + } rv = IncrementalScan(verbose); } if (!devlist) { @@ -1533,6 +1541,10 @@ int main(int argc, char *argv[]) rv = 1; break; } + if (devmode == 'f') { + rv = IncrementalRemove(devlist->devname, verbose-quiet); + break; + } rv = Incremental(devlist->devname, verbose-quiet, runstop, ss, homehost, require_homehost, autof); break; |