aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Marzinski <bmarzins@redhat.com>2012-01-12 22:17:21 -0600
committerChristophe Varoqui <christophe.varoqui@opensvc.com>2012-01-14 12:16:50 +0100
commit63704387009443bdb37d9deaaafa9ab121d45bfb (patch)
treecfbe1d775ff7d127ba30e14ccd9bebf77315e435
parentd49d4d7c0666c0a0bcac2c72c8402d1c1e9c3c8c (diff)
downloadmultipath-tools-63704387009443bdb37d9deaaafa9ab121d45bfb.tar.gz
multipath: don't remove dm device on remove ueventHEADmaster
multipathd gets remove uevents for dm devices when the devices have been removed. It shouldn't try to actually remove the device itself, since that has already been done, or it wouldn't have gotten the uevent. Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
-rw-r--r--multipathd/main.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/multipathd/main.c b/multipathd/main.c
index 3b68642..cbb70c1 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -310,7 +310,8 @@ static int
uev_remove_map (struct uevent * uev, struct vectors * vecs)
{
char *alias;
- int minor, rc;
+ int minor;
+ struct multipath *mpp;
condlog(2, "%s: remove map (uevent)", uev->kernel);
alias = uevent_get_dm_name(uev);
@@ -319,9 +320,24 @@ uev_remove_map (struct uevent * uev, struct vectors * vecs)
return 0;
}
minor = uevent_get_minor(uev);
- rc = ev_remove_map(uev->kernel, alias, minor, vecs);
+ mpp = find_mp_by_minor(vecs->mpvec, minor);
+
+ if (!mpp) {
+ condlog(2, "%s: devmap not registered, can't remove",
+ uev->kernel);
+ goto out;
+ }
+ if (strcmp(mpp->alias, alias)) {
+ condlog(2, "%s: minor number mismatch (map %d, event %d)",
+ mpp->alias, mpp->dmi->minor, minor);
+ goto out;
+ }
+
+ orphan_paths(vecs->pathvec, mpp);
+ remove_map_and_stop_waiter(mpp, vecs, 1);
+out:
FREE(alias);
- return rc;
+ return 0;
}
int