dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>,
	Martin Wilck <Martin.Wilck@suse.com>
Subject: [dm-devel] [PATCH v2 4/6] libmultipath: remove unneeded code in coalesce_paths
Date: Thu,  2 Sep 2021 16:57:47 -0500	[thread overview]
Message-ID: <1630619869-12251-5-git-send-email-bmarzins@redhat.com> (raw)
In-Reply-To: <1630619869-12251-1-git-send-email-bmarzins@redhat.com>

The code at the end of coalesce_paths() removes a multipath device that
was just created/reloaded, if none of its path devices have pp->dev set.
This code is very old, and no longer has any actual effect. Multipath
devices no longer get placed in pathvec without having pp->dev set. Even
if they could, there's no point in creating/reloading the device and
then immediately removing it.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 libmultipath/configure.c | 46 ----------------------------------------
 1 file changed, 46 deletions(-)

diff --git a/libmultipath/configure.c b/libmultipath/configure.c
index 2f417914..3f241c5c 100644
--- a/libmultipath/configure.c
+++ b/libmultipath/configure.c
@@ -1060,28 +1060,6 @@ int domap(struct multipath *mpp, char *params, int is_daemon)
 	return DOMAP_FAIL;
 }
 
-static int
-deadmap (struct multipath * mpp)
-{
-	int i, j;
-	struct pathgroup * pgp;
-	struct path * pp;
-
-	if (!mpp->pg)
-		return 1;
-
-	vector_foreach_slot (mpp->pg, pgp, i) {
-		if (!pgp->paths)
-			continue;
-
-		vector_foreach_slot (pgp->paths, pp, j)
-			if (strlen(pp->dev))
-				return 0; /* alive */
-	}
-
-	return 1; /* dead */
-}
-
 extern int
 check_daemon(void)
 {
@@ -1313,30 +1291,6 @@ int coalesce_paths (struct vectors *vecs, vector mpvec, char *refwwid,
 			remove_map(mpp, vecs->pathvec, vecs->mpvec,
 				   KEEP_VEC);
 	}
-	/*
-	 * Flush maps with only dead paths (ie not in sysfs)
-	 * Keep maps with only failed paths
-	 */
-	if (mpvec) {
-		vector_foreach_slot (newmp, mpp, i) {
-			char alias[WWID_SIZE];
-
-			if (!deadmap(mpp))
-				continue;
-
-			strlcpy(alias, mpp->alias, WWID_SIZE);
-
-			vector_del_slot(newmp, i);
-			i--;
-			remove_map(mpp, vecs->pathvec, vecs->mpvec, KEEP_VEC);
-
-			if (dm_flush_map(alias))
-				condlog(2, "%s: remove failed (dead)",
-					alias);
-			else
-				condlog(2, "%s: remove (dead)", alias);
-		}
-	}
 	ret = CP_OK;
 out:
 	free(size_mismatch_seen);
-- 
2.17.2

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


  parent reply	other threads:[~2021-09-02 22:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02 21:57 [dm-devel] [PATCH v2 0/6] Mulitpath: miscellaneous patches Benjamin Marzinski
2021-09-02 21:57 ` [dm-devel] [PATCH v2 1/6] multipath.conf: fix typo in ghost_delay description Benjamin Marzinski
2021-09-02 21:57 ` [dm-devel] [PATCH v2 2/6] mpathpersist: fail commands when no usable paths exist Benjamin Marzinski
2021-09-02 21:57 ` [dm-devel] [PATCH v2 3/6] multipath: print warning if multipathd is not running Benjamin Marzinski
2021-09-03  8:20   ` Martin Wilck
2021-09-02 21:57 ` Benjamin Marzinski [this message]
2021-09-02 21:57 ` [dm-devel] [PATCH v2 5/6] libmultipath: deal with dynamic PTHREAD_STACK_MIN Benjamin Marzinski
2021-09-02 21:57 ` [dm-devel] [PATCH v2 6/6] libmultipath: drop unnecessary parameter from remove_map() Benjamin Marzinski
2021-09-03  9:28   ` Martin Wilck
2021-09-03 15:22     ` Martin Wilck
2021-09-03 17:17       ` Benjamin Marzinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1630619869-12251-5-git-send-email-bmarzins@redhat.com \
    --to=bmarzins@redhat.com \
    --cc=Martin.Wilck@suse.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    --subject='Re: [dm-devel] [PATCH v2 4/6] libmultipath: remove unneeded code in coalesce_paths' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).