Blame SOURCES/0129-libmultipath-select-resize-action-even-if-reload-is-.patch

108c2a
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
108c2a
From: Benjamin Marzinski <bmarzins@redhat.com>
108c2a
Date: Tue, 31 Jan 2023 09:58:55 -0600
108c2a
Subject: [PATCH] libmultipath: select resize action even if reload is forced
108c2a
108c2a
The ACT_RESIZE action is the same as the ACT_RELOAD action, except that
108c2a
it flushes outstanding IO because the device size is changing and
108c2a
the new size might be too small for some of the outstanding IO. If we've
108c2a
detected a size change, and a forced reload is requested, we still need
108c2a
to flush the IO because the reload will change the device size.
108c2a
108c2a
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
108c2a
---
108c2a
 libmultipath/configure.c | 13 +++++++------
108c2a
 1 file changed, 7 insertions(+), 6 deletions(-)
108c2a
108c2a
diff --git a/libmultipath/configure.c b/libmultipath/configure.c
108c2a
index 6e06fea2..ecf24f95 100644
108c2a
--- a/libmultipath/configure.c
108c2a
+++ b/libmultipath/configure.c
108c2a
@@ -734,17 +734,18 @@ select_action (struct multipath * mpp, vector curmp, int force_reload)
108c2a
 		return;
108c2a
 	}
108c2a
 
108c2a
-	if (force_reload) {
108c2a
+	if (cmpp->size != mpp->size) {
108c2a
 		mpp->force_udev_reload = 1;
108c2a
-		mpp->action = ACT_RELOAD;
108c2a
-		condlog(3, "%s: set ACT_RELOAD (forced by user)",
108c2a
+		mpp->action = ACT_RESIZE;
108c2a
+		condlog(3, "%s: set ACT_RESIZE (size change)",
108c2a
 			mpp->alias);
108c2a
 		return;
108c2a
 	}
108c2a
-	if (cmpp->size != mpp->size) {
108c2a
+
108c2a
+	if (force_reload) {
108c2a
 		mpp->force_udev_reload = 1;
108c2a
-		mpp->action = ACT_RESIZE;
108c2a
-		condlog(3, "%s: set ACT_RESIZE (size change)",
108c2a
+		mpp->action = ACT_RELOAD;
108c2a
+		condlog(3, "%s: set ACT_RELOAD (forced by user)",
108c2a
 			mpp->alias);
108c2a
 		return;
108c2a
 	}