diff options
author | Benjamin Marzinski <bmarzins@redhat.com> | 2009-03-12 13:38:11 -0500 |
---|---|---|
committer | Christophe Varoqui <christophe.varoqui@free.fr> | 2009-04-03 23:55:29 +0200 |
commit | 2275a916feb7430c93c9686479775353100fc876 (patch) | |
tree | 5024b962bc0549a8b77629dc131181ff8c07fd3f /multipathd | |
parent | 1d80fee3649f66fbb49a3225af97eb90adf2c9d5 (diff) | |
download | multipath-tools-2275a916feb7430c93c9686479775353100fc876.tar.gz multipath-tools-2275a916feb7430c93c9686479775353100fc876.tar.bz2 multipath-tools-2275a916feb7430c93c9686479775353100fc876.zip |
remove deleted path from pathvec
When the last path in a multipath map was removed, the path wasn't getting
deleted from the pathvec before it was getting freed.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Diffstat (limited to 'multipathd')
-rw-r--r-- | multipathd/main.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/multipathd/main.c b/multipathd/main.c index c23fda7..a5b61e6 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -488,7 +488,7 @@ ev_remove_path (char * devname, struct vectors * vecs) if (update_mpp_paths(mpp, vecs->pathvec)) { condlog(0, "%s: failed to update paths", mpp->alias); - goto out; + goto fail; } if ((i = find_slot(mpp->paths, (void *)pp)) != -1) vector_del_slot(mpp->paths, i); @@ -507,8 +507,8 @@ ev_remove_path (char * devname, struct vectors * vecs) condlog(2, "%s: removed map after" " removing all paths", alias); - free_path(pp); - return 0; + retval = 0; + goto out; } /* * Not an error, continue @@ -519,7 +519,7 @@ ev_remove_path (char * devname, struct vectors * vecs) condlog(0, "%s: failed to setup map for" " removal of path %s", mpp->alias, devname); - goto out; + goto fail; } /* * reload the map @@ -535,7 +535,7 @@ ev_remove_path (char * devname, struct vectors * vecs) * update our state from kernel */ if (setup_multipath(vecs, mpp)) { - goto out; + goto fail; } sync_map_state(mpp); @@ -544,6 +544,7 @@ ev_remove_path (char * devname, struct vectors * vecs) } } +out: if ((i = find_slot(vecs->pathvec, (void *)pp)) != -1) vector_del_slot(vecs->pathvec, i); @@ -551,7 +552,7 @@ ev_remove_path (char * devname, struct vectors * vecs) return retval; -out: +fail: remove_map_and_stop_waiter(mpp, vecs, 1); return 1; } |