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

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