From patchwork Thu Mar 12 18:38:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 11521 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2CIg2x3014116 for ; Thu, 12 Mar 2009 18:42:02 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 3457961AAFE; Thu, 12 Mar 2009 14:42:02 -0400 (EDT) Received: from int-mx2.corp.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n2CIfx0s021794 for ; Thu, 12 Mar 2009 14:41:59 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n2CIfwPJ021261; Thu, 12 Mar 2009 14:41:58 -0400 Received: from ether.msp.redhat.com (ether.msp.redhat.com [10.15.80.119]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n2CIfvv3021025; Thu, 12 Mar 2009 14:41:57 -0400 Received: from ether.msp.redhat.com (localhost.localdomain [127.0.0.1]) by ether.msp.redhat.com (8.14.1/8.14.1) with ESMTP id n2CIcDWn003015; Thu, 12 Mar 2009 13:38:13 -0500 Received: (from bmarzins@localhost) by ether.msp.redhat.com (8.14.1/8.14.1/Submit) id n2CIcDeF003014; Thu, 12 Mar 2009 13:38:13 -0500 From: Benjamin Marzinski To: dm-devel@redhat.com Date: Thu, 12 Mar 2009 13:38:11 -0500 Message-Id: <1236883093-2989-2-git-send-email-bmarzins@redhat.com> In-Reply-To: <1236883093-2989-1-git-send-email-bmarzins@redhat.com> References: <1236883093-2989-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-loop: dm-devel@redhat.com Cc: Subject: [dm-devel] [PATCH 1/3] remove deleted path from pathvec X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com 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 --- 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; }