FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 03-12-2009, 05:38 PM
Benjamin Marzinski
 
Default 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>
---
multipathd/main.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/multipathd/main.c b/multipathd/main.c
index 36aa93c..98153df 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;
}
--
1.5.3.3

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 12:23 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org