All of lore.kernel.org
 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: [PATCH 10/15] libmultipath: change how the checker async is set
Date: Thu, 16 Jan 2020 20:18:15 -0600	[thread overview]
Message-ID: <1579227500-17196-11-git-send-email-bmarzins@redhat.com> (raw)
In-Reply-To: <1579227500-17196-1-git-send-email-bmarzins@redhat.com>

The way that the checkers async mode worked in multipathd didn't make
much sense. When multipathd starts up, all checker classes are in the
sync mode, and any pathinfo() calls on devices would run the checker in
sync mode. However, the First time a checker class was used in
checkerloop, it would set that checker class to async (assuming
force_sync wasn't set).  After that, no matter when a checker from that
class was called, it would always run in async mode.  Multipathd doesn't
need to run checkers in sync mode at all, so don't.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 libmpathpersist/mpath_persist.c |  2 +-
 libmultipath/discovery.c        | 10 ++++------
 multipath/main.c                |  1 +
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c
index 603cfc3b..b2238f00 100644
--- a/libmpathpersist/mpath_persist.c
+++ b/libmpathpersist/mpath_persist.c
@@ -47,7 +47,7 @@ mpath_lib_init (void)
 		condlog(0, "Failed to initialize multipath config.");
 		return NULL;
 	}
-
+	conf->force_sync = 1;
 	set_max_fds(conf->max_fds);
 
 	return conf;
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index d2773c3a..1ab093f4 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -1643,12 +1643,10 @@ get_state (struct path * pp, struct config *conf, int daemon, int oldstate)
 	if (pp->mpp && !c->mpcontext)
 		checker_mp_init(c, &pp->mpp->mpcontext);
 	checker_clear_message(c);
-	if (daemon) {
-		if (conf->force_sync == 0)
-			checker_set_async(c);
-		else
-			checker_set_sync(c);
-	}
+	if (conf->force_sync == 0)
+		checker_set_async(c);
+	else
+		checker_set_sync(c);
 	if (!conf->checker_timeout &&
 	    sysfs_get_timeout(pp, &(c->timeout)) <= 0)
 		c->timeout = DEF_TIMEOUT;
diff --git a/multipath/main.c b/multipath/main.c
index 4f4d8e89..aebabd9b 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -905,6 +905,7 @@ main (int argc, char *argv[])
 		exit(RTVL_FAIL);
 	multipath_conf = conf;
 	conf->retrigger_tries = 0;
+	conf->force_sync = 1;
 	while ((arg = getopt(argc, argv, ":adcChl::FfM:v:p:b:BrR:itTquUwW")) != EOF ) {
 		switch(arg) {
 		case 1: printf("optarg : %s\n",optarg);
-- 
2.17.2

  parent reply	other threads:[~2020-01-17  2:18 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17  2:18 [PATCH 00/15] Multipath patch dump Benjamin Marzinski
2020-01-17  2:18 ` [PATCH 01/15] multipathd: warn when configuration has been changed Benjamin Marzinski
2020-01-17 15:45   ` Martin Wilck
2020-01-22 11:59     ` Benjamin Marzinski
2020-01-17 15:51   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 02/15] libmultipath: fix leak in foreign code Benjamin Marzinski
2020-01-17 15:50   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 03/15] Fix leak in mpathpersist Benjamin Marzinski
2020-01-17 15:53   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 04/15] libmultipath: remove unused path->prio_args Benjamin Marzinski
2020-01-17 15:55   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 05/15] libmultipath: constify get_unaligned_be* Benjamin Marzinski
2020-01-17 15:57   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 06/15] libmultipath: add missing hwe mpe variable merges Benjamin Marzinski
2020-01-17 16:04   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 07/15] libmultipath: fix sgio_get_vpd looping Benjamin Marzinski
2020-01-17 16:27   ` Martin Wilck
2020-01-20 16:59     ` Benjamin Marzinski
2020-01-17  2:18 ` [PATCH 08/15] libmultipath: add vend_id to get_vpd_sgio Benjamin Marzinski
2020-01-17 16:58   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 09/15] libmultipath: add code to get vendor specific vpd data Benjamin Marzinski
2020-01-17 16:56   ` Martin Wilck
2020-01-22  8:51     ` Benjamin Marzinski
2020-01-22 11:52       ` Martin Wilck
2020-01-22 12:20         ` Benjamin Marzinski
2020-01-18 17:34   ` John Stoffel
2020-01-22  9:46     ` Benjamin Marzinski
2020-01-17  2:18 ` Benjamin Marzinski [this message]
2020-01-17 17:02   ` [PATCH 10/15] libmultipath: change how the checker async is set Martin Wilck
2020-01-17 17:04   ` Martin Wilck
2020-01-18 17:43   ` John Stoffel
2020-01-20 15:07     ` Benjamin Marzinski
2020-01-20 20:20       ` John Stoffel
2020-01-21 12:49         ` Benjamin Marzinski
2020-01-21 20:13           ` John Stoffel
2020-01-17  2:18 ` [PATCH 11/15] libmultipath: change failed path prio timeout Benjamin Marzinski
2020-01-17 17:18   ` Martin Wilck
2020-01-20 16:22     ` Benjamin Marzinski
2020-01-17  2:18 ` [PATCH 12/15] multipathd: add new paths under vecs lock Benjamin Marzinski
2020-01-17 17:39   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 13/15] libmultipath: add new checker class functions Benjamin Marzinski
2020-01-17 17:41   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 14/15] libmultipath: make directio checker share io contexts Benjamin Marzinski
2020-01-20  8:09   ` Martin Wilck
2020-01-20 16:08     ` Benjamin Marzinski
2020-01-21  8:55       ` Martin Wilck
2020-01-17  2:18 ` [PATCH 15/15] tests: add directio unit tests Benjamin Marzinski
2020-01-20  8:27   ` Martin Wilck
2020-01-20 15:25     ` 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=1579227500-17196-11-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 \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.