Re: [PATCH 02/10] libmultipath: fix detect alua corner case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2018-07-13 at 14:39 -0500, Benjamin Marzinski wrote:
> If retain_attach_hw_handler = no, then the paths tpgs state will
> never
> be checked, and the multipath device will always select the alua
> handler, if no other handler is selected. The paths tpgs state
> should be checked, regardless of the retain_hwhandler value.
> 
> Signed-off-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx>
> ---
>  libmultipath/propsel.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Martin Wilck <mwilck@xxxxxxxx>

> 
> diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
> index af3ed62..fdb5953 100644
> --- a/libmultipath/propsel.c
> +++ b/libmultipath/propsel.c
> @@ -420,9 +420,11 @@ int select_hwhandler(struct config *conf, struct
> multipath *mp)
>  	bool all_tpgs = true;
>  
>  	dh_state = &handler[2];
> +
> +	vector_foreach_slot(mp->paths, pp, i)
> +		all_tpgs = all_tpgs && (pp->tpgs > 0);
>  	if (mp->retain_hwhandler != RETAIN_HWHANDLER_OFF) {
>  		vector_foreach_slot(mp->paths, pp, i) {
> -			all_tpgs = all_tpgs && (pp->tpgs > 0);
>  			if (get_dh_state(pp, dh_state,
> sizeof(handler) - 2) > 0
>  			    && strcmp(dh_state, "detached")) {
>  				memcpy(handler, "1 ", 2);

-- 
Dr. Martin Wilck <mwilck@xxxxxxxx>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux