Blame SOURCES/0042-multipathd-disallow-changing-to-from-fpin-marginal-p.patch

da32ae
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
da32ae
From: Benjamin Marzinski <bmarzins@redhat.com>
da32ae
Date: Fri, 11 Feb 2022 17:23:39 -0600
da32ae
Subject: [PATCH] multipathd: disallow changing to/from fpin marginal paths on
da32ae
 reconfig
da32ae
da32ae
Setting marginal_pathgroups to fpin causes two new threads to be created
da32ae
when multipathd starts.  Turning it on after multipathd starts up won't
da32ae
cause the theads to start, and turing it off won't keep the threads from
da32ae
working. So disallow changing marginal_pathgroups to/from "fpin" on
da32ae
reconfigure.
da32ae
da32ae
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
da32ae
---
da32ae
 multipath/multipath.conf.5 | 13 ++++++++-----
da32ae
 multipathd/main.c          |  9 +++++++++
da32ae
 2 files changed, 17 insertions(+), 5 deletions(-)
da32ae
da32ae
diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5
da32ae
index 5ed2cd3c..58ad5c9c 100644
da32ae
--- a/multipath/multipath.conf.5
da32ae
+++ b/multipath/multipath.conf.5
da32ae
@@ -1102,15 +1102,18 @@ have been tried first. This prevents the possibility of IO errors occuring
da32ae
 while marginal paths are still usable. After the path has been monitored
da32ae
 for the configured time, and is declared healthy, it will be returned to its
da32ae
 normal pathgroup.
da32ae
-However if this option is set to \fIfpin\fR multipathd will receive fpin
da32ae
+If this option is set to \fIfpin\fR, multipathd will receive fpin
da32ae
 notifications, set path states to "marginal" accordingly, and regroup paths
da32ae
-as described for "marginal_pathgroups yes". This option can't be used in combination
da32ae
-with other options for "Shaky path detection" (see below).If it is set to fpin,
da32ae
-marginal_path_xyz and san_path_err_xyz parameters are implicitly set to 0.
da32ae
+as described for \fIon\fR. This option can't be used in combination
da32ae
+with other options for "Shaky path detection" (see below). \fBNote:\fR If this
da32ae
+is set to \fIfpin\fR, the \fImarginal_path_*\fR and \fIsan_path_err_*\fR
da32ae
+options are implicitly set to \fIno\fP. Also, this option cannot be switched
da32ae
+either to or from \fIfpin\fR on a multipathd reconfigure. multipathd must be
da32ae
+restarted for the change to take effect.
da32ae
 See "Shaky paths detection" below for more information.
da32ae
 .RS
da32ae
 .TP
da32ae
-The default is: \fBno\fR
da32ae
+The default is: \fBoff\fR
da32ae
 .RE
da32ae
 .
da32ae
 .
da32ae
diff --git a/multipathd/main.c b/multipathd/main.c
da32ae
index 53be9b95..45b9572f 100644
da32ae
--- a/multipathd/main.c
da32ae
+++ b/multipathd/main.c
da32ae
@@ -2792,6 +2792,7 @@ int
da32ae
 reconfigure (struct vectors * vecs)
da32ae
 {
da32ae
 	struct config * old, *conf;
da32ae
+	int old_marginal_pathgroups;
da32ae
 
da32ae
 	conf = load_config(DEFAULT_CONFIGFILE);
da32ae
 	if (!conf)
da32ae
@@ -2819,6 +2820,14 @@ reconfigure (struct vectors * vecs)
da32ae
 	uxsock_timeout = conf->uxsock_timeout;
da32ae
 
da32ae
 	old = rcu_dereference(multipath_conf);
da32ae
+	old_marginal_pathgroups = old->marginal_pathgroups;
da32ae
+	if ((old_marginal_pathgroups == MARGINAL_PATHGROUP_FPIN) !=
da32ae
+	    (conf->marginal_pathgroups == MARGINAL_PATHGROUP_FPIN)) {
da32ae
+		condlog(1, "multipathd must be restarted to turn %s fpin marginal paths",
da32ae
+			(old_marginal_pathgroups == MARGINAL_PATHGROUP_FPIN)?
da32ae
+			"off" : "on");
da32ae
+		conf->marginal_pathgroups = old_marginal_pathgroups;
da32ae
+	}
da32ae
 	conf->sequence_nr = old->sequence_nr + 1;
da32ae
 	rcu_assign_pointer(multipath_conf, conf);
da32ae
 	call_rcu(&old->rcu, rcu_free_config);