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

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