[03/12] multipath: fix hwhandler check in select_action
diff mbox

Message ID 1512672546-12785-4-git-send-email-bmarzins@redhat.com
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show

Commit Message

Benjamin Marzinski Dec. 7, 2017, 6:48 p.m. UTC
If the existing multipath table does not have a hardware handler set,
then even if retain_hwhandler is enabled on the new table, it may still
be possible to set the hardware handler on reload. So, adding a
hardware handler to the table should trigger a reload in this case.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 libmultipath/configure.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Martin Wilck Dec. 7, 2017, 10:09 p.m. UTC | #1
On Thu, 2017-12-07 at 12:48 -0600, Benjamin Marzinski wrote:
> If the existing multipath table does not have a hardware handler set,
> then even if retain_hwhandler is enabled on the new table, it may
> still
> be possible to set the hardware handler on reload. So, adding a
> hardware handler to the table should trigger a reload in this case.
> 
> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>

Patch
diff mbox

diff --git a/libmultipath/configure.c b/libmultipath/configure.c
index 09cbe3c..0dfa250 100644
--- a/libmultipath/configure.c
+++ b/libmultipath/configure.c
@@ -563,7 +563,8 @@  select_action (struct multipath * mpp, vector curmp, int force_reload)
 			mpp->alias);
 		return;
 	}
-	if (mpp->retain_hwhandler != RETAIN_HWHANDLER_ON &&
+	if ((mpp->retain_hwhandler != RETAIN_HWHANDLER_ON ||
+	     strcmp(cmpp->hwhandler, "0") == 0) &&
 	    (strlen(cmpp->hwhandler) != strlen(mpp->hwhandler) ||
 	     strncmp(cmpp->hwhandler, mpp->hwhandler,
 		    strlen(mpp->hwhandler)))) {