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