diff mbox series

[2/4] libmultipath: select resize action even if reload is forced

Message ID 1675193661-1147-3-git-send-email-bmarzins@redhat.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series multipath: fix multipathd renaming issue | expand

Commit Message

Benjamin Marzinski Jan. 31, 2023, 7:34 p.m. UTC
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 <bmarzins@redhat.com>
---
 libmultipath/configure.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Comments

Martin Wilck Feb. 1, 2023, 7:59 a.m. UTC | #1
On Tue, 2023-01-31 at 13:34 -0600, Benjamin Marzinski wrote:
> 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 <bmarzins@redhat.com>

Reviewed-by: Martin Wilck <mwilck@suse.com>

> ---
>  libmultipath/configure.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/libmultipath/configure.c b/libmultipath/configure.c
> index 050b984a..6811e661 100644
> --- a/libmultipath/configure.c
> +++ b/libmultipath/configure.c
> @@ -727,11 +727,6 @@ void select_action (struct multipath *mpp, const
> struct _vector *curmp,
>                 return;
>         }
>  
> -       if (force_reload) {
> -               mpp->force_udev_reload = 1;
> -               select_reload_action(mpp, "forced by user");
> -               return;
> -       }
>         if (cmpp->size != mpp->size) {
>                 mpp->force_udev_reload = 1;
>                 mpp->action = ACT_RESIZE;
> @@ -740,6 +735,12 @@ void select_action (struct multipath *mpp, const
> struct _vector *curmp,
>                 return;
>         }
>  
> +       if (force_reload) {
> +               mpp->force_udev_reload = 1;
> +               select_reload_action(mpp, "forced by user");
> +               return;
> +       }
> +
>         if (!is_udev_ready(cmpp) && count_active_paths(mpp) > 0) {
>                 mpp->force_udev_reload = 1;
>                 select_reload_action(mpp, "udev incomplete");

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
diff mbox series

Patch

diff --git a/libmultipath/configure.c b/libmultipath/configure.c
index 050b984a..6811e661 100644
--- a/libmultipath/configure.c
+++ b/libmultipath/configure.c
@@ -727,11 +727,6 @@  void select_action (struct multipath *mpp, const struct _vector *curmp,
 		return;
 	}
 
-	if (force_reload) {
-		mpp->force_udev_reload = 1;
-		select_reload_action(mpp, "forced by user");
-		return;
-	}
 	if (cmpp->size != mpp->size) {
 		mpp->force_udev_reload = 1;
 		mpp->action = ACT_RESIZE;
@@ -740,6 +735,12 @@  void select_action (struct multipath *mpp, const struct _vector *curmp,
 		return;
 	}
 
+	if (force_reload) {
+		mpp->force_udev_reload = 1;
+		select_reload_action(mpp, "forced by user");
+		return;
+	}
+
 	if (!is_udev_ready(cmpp) && count_active_paths(mpp) > 0) {
 		mpp->force_udev_reload = 1;
 		select_reload_action(mpp, "udev incomplete");