diff mbox series

[1/3] libmultipath: Don't skip set_path_max_sectors_kb()

Message ID 20241205035638.1218953-2-bmarzins@redhat.com (mailing list archive)
State Not Applicable, archived
Delegated to: Benjamin Marzinski
Headers show
Series handle maps that need reloading | expand

Commit Message

Benjamin Marzinski Dec. 5, 2024, 3:56 a.m. UTC
If a multipath device already has need_reload set when a path is
adopted, it won't call set_path_max_sectors_kb() because of
short-circuit evaluation. This isn't what's intended.

Fixes: e5e20c7b ("libmultipath: set max_sectors_kb in adopt_paths()")
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 libmultipath/structs_vec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Martin Wilck Dec. 5, 2024, 10:43 a.m. UTC | #1
On Wed, 2024-12-04 at 22:56 -0500, Benjamin Marzinski wrote:
> If a multipath device already has need_reload set when a path is
> adopted, it won't call set_path_max_sectors_kb() because of
> short-circuit evaluation. This isn't what's intended.
> 
> Fixes: e5e20c7b ("libmultipath: set max_sectors_kb in adopt_paths()")
> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
>  libmultipath/structs_vec.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
> index d22056ca..60051092 100644
> --- a/libmultipath/structs_vec.c
> +++ b/libmultipath/structs_vec.c
> @@ -335,8 +335,7 @@ int adopt_paths(vector pathvec, struct multipath
> *mpp,
>  				 */
>  				if (!current_mpp ||
>  				   
> !mp_find_path_by_devt(current_mpp, pp->dev_t))
> -					mpp->need_reload = mpp-
> >need_reload ||
> -
> 						set_path_max_sectors_kb(pp, mpp->max_sectors_kb);
> +					mpp->need_reload =
> set_path_max_sectors_kb(pp, mpp->max_sectors_kb) || mpp->need_reload;
>  			}
>  
>  			pp->mpp = mpp;

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

Patch

diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index d22056ca..60051092 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -335,8 +335,7 @@  int adopt_paths(vector pathvec, struct multipath *mpp,
 				 */
 				if (!current_mpp ||
 				    !mp_find_path_by_devt(current_mpp, pp->dev_t))
-					mpp->need_reload = mpp->need_reload ||
-						set_path_max_sectors_kb(pp, mpp->max_sectors_kb);
+					mpp->need_reload = set_path_max_sectors_kb(pp, mpp->max_sectors_kb) || mpp->need_reload;
 			}
 
 			pp->mpp = mpp;