]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.c
added --path <path_id> to give the information on the 'path-id' of removed device
[thirdparty/mdadm.git] / mdadm.c
diff --git a/mdadm.c b/mdadm.c
index 4a8547486c36fa35108ec5d2ae004683eb4f3c25..0eef6bc80738a6d0e3cd7447cf41b9de00171c2c 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -104,6 +104,7 @@ int main(int argc, char *argv[])
        int rebuild_map = 0;
        int auto_update_home = 0;
        char *subarray = NULL;
+       char *remove_path = NULL;
 
        int print_help = 0;
        FILE *outf;
@@ -943,6 +944,9 @@ int main(int argc, char *argv[])
                case O(INCREMENTAL, 'r'):
                        rebuild_map = 1;
                        continue;
+               case O(INCREMENTAL, IncrementalPath):
+                       remove_path = optarg;
+                       continue;
                }
                /* We have now processed all the valid options. Anything else is
                 * an error
@@ -1586,12 +1590,13 @@ 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);
+               if (devmode == 'f')
+                       rv = IncrementalRemove(devlist->devname, remove_path,
+                                              verbose-quiet);
+               else
+                       rv = Incremental(devlist->devname, verbose-quiet,
+                                        runstop, ss, homehost,
+                                        require_homehost, autof);
                break;
        case AUTODETECT:
                autodetect();