]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
config: enhance name matching in conf_get_ident.
authorNeilBrown <neilb@suse.de>
Mon, 11 May 2009 05:47:10 +0000 (15:47 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 11 May 2009 05:47:10 +0000 (15:47 +1000)
Use when searching mdadm.conf for a device, use more flexible
matching that e.g. ignores leading /dev/md/ or /dev/

As mdadm now accepts both "/dev/md/foo" and "foo" is many places as
equivalent, they should compare as the same.

Signed-off-by: NeilBrown <neilb@suse.de>
config.c

index 284896ed121190524247fb0c95cb89865ae0afb2..d171b1e92ef3b406bd3fd685f8ce33b5c5da438d 100644 (file)
--- a/config.c
+++ b/config.c
@@ -811,7 +811,7 @@ mddev_ident_t conf_get_ident(char *dev)
        load_conffile();
        rv = mddevlist;
        while (dev && rv && (rv->devname == NULL
-                            || strcmp(dev, rv->devname)!=0))
+                            || !devname_matches(dev, rv->devname)))
                rv = rv->next;
        return rv;
 }