]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdmon.c
imsm: fix family number handling
[thirdparty/mdadm.git] / mdmon.c
diff --git a/mdmon.c b/mdmon.c
index acb36a2d6f2621ad9ec26daf95522bbe04b3c4aa..37f97af1761721230127ca65ee65a96c6a776301 100644 (file)
--- a/mdmon.c
+++ b/mdmon.c
@@ -1,8 +1,8 @@
 /*
  * mdmon - monitor external metadata arrays
  *
- * Copyright (C) 2007-2008 Neil Brown <neilb@suse.de>
- * Copyright (C) 2007-2008 Intel Corporation
+ * Copyright (C) 2007-2009 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2007-2009 Intel Corporation
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -306,6 +306,13 @@ int main(int argc, char *argv[])
                        if (strncmp(e->metadata_version, "external:", 9) == 0 &&
                            !is_subarray(&e->metadata_version[9])) {
                                devname = devnum2devname(e->devnum);
+                               /* update cmdline so this mdmon instance can be
+                                * distinguished from others in a call to ps(1)
+                                */
+                               if (strlen(devname) <= strlen(container_name)) {
+                                       memset(container_name, 0, strlen(container_name));
+                                       sprintf(container_name, "%s", devname);
+                               }
                                status |= mdmon(devname, e->devnum, scan,
                                                switchroot);
                        }
@@ -400,7 +407,7 @@ int mdmon(char *devname, int devnum, int scan, char *switchroot)
        }
 
        mdi = sysfs_read(mdfd, container->devnum,
-                        GET_VERSION|GET_LEVEL|GET_DEVS);
+                        GET_VERSION|GET_LEVEL|GET_DEVS|SKIP_GONE_DEVS);
 
        if (!mdi) {
                fprintf(stderr, "mdmon: failed to load sysfs info for %s\n",