summaryrefslogtreecommitdiffstats
path: root/Incremental.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-08-26 07:24:53 +0200
committerNeilBrown <neilb@suse.de>2013-08-26 07:24:53 +0200
commitd3786cdcd04fe0f5d8f43f2de4cffccbe4f45fbe (patch)
tree273fe8c7119f0aa002329073c64bb32a6f4f5280 /Incremental.c
parentsuper1: fix setting of data_offset for 1.0 metadata. (diff)
downloadmdadm-d3786cdcd04fe0f5d8f43f2de4cffccbe4f45fbe.tar.xz
mdadm-d3786cdcd04fe0f5d8f43f2de4cffccbe4f45fbe.zip
Change "mdadm --run" to use the same code as "mdadm --IRs".
Current "mdadm --run /dev/mdX" will not handle external metadata properly. mdmon won't be started etc. So use the code from "mdadm -IRs" instead - that already does all the right things. Reported-by: Francis Moreau <francis.moro@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Incremental.c')
-rw-r--r--Incremental.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Incremental.c b/Incremental.c
index fbaa29fe..06415ed6 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -1278,7 +1278,7 @@ static int try_spare(char *devname, int *dfdp, struct dev_policy *pol,
return rv;
}
-int IncrementalScan(int verbose)
+int IncrementalScan(int verbose, char *devnm)
{
/* look at every device listed in the 'map' file.
* If one is found that is not running then:
@@ -1298,7 +1298,11 @@ int IncrementalScan(int verbose)
mdu_array_info_t array;
mdu_bitmap_file_t bmf;
struct mdinfo *sra;
- int mdfd = open_dev(me->devnm);
+ int mdfd;
+
+ if (devnm && strcmp(devnm, me->devnm) != 0)
+ continue;
+ mdfd = open_dev(me->devnm);
if (mdfd < 0)
continue;