Date: Sun, 5 Aug 2012 00:29:48 +0200 (CEST) From: Thomas Quinot <thomas@cuivre.fr.eu.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/170379: geom_multipath: rotate only considers last 2 valid providers Message-ID: <20120804222948.ADAF7382A@melamine.cuivre.fr.eu.org> Resent-Message-ID: <201208042230.q74MU1n0080633@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 170379 >Category: kern >Synopsis: geom_multipath: rotate only considers last 2 valid providers >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Aug 04 22:30:01 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Thomas Quinot >Release: FreeBSD 8.3-STABLE amd64 >Organization: >Environment: System: FreeBSD melamine.cuivre.fr.eu.org 8.3-STABLE FreeBSD 8.3-STABLE #4: Sat Jul 14 15:27:47 CEST 2012 thomas@melamine.cuivre.fr.eu.org:/usr/obj/usr/src/sys/GENERIC amd64 >Description: "gmultipath rotate" only alternates between the last two valid providers, instead of rotating over all providers. >How-To-Repeat: # gmultipath status Name Status Components multipath/mm OPTIMAL md3 (ACTIVE) md2 (PASSIVE) md1 (PASSIVE) md0 (PASSIVE) # gmultipath rotate mm;gml ultipath status mm Name Status Components multipath/mm OPTIMAL md3 (PASSIVE) md2 (PASSIVE) md1 (PASSIVE) md0 (ACTIVE) # gmultipath rotate mm;gmultipath status mm Name Status Components multipath/mm OPTIMAL md3 (PASSIVE) md2 (PASSIVE) md1 (ACTIVE) md0 (PASSIVE) # gmultipath rotate mm;gmultipath status mm Name Status Components multipath/mm OPTIMAL md3 (PASSIVE) md2 (PASSIVE) md1 (PASSIVE) md0 (ACTIVE) # gmultipath rotate mm;gmultipath status mm Name Status Components multipath/mm OPTIMAL md3 (PASSIVE) md2 (PASSIVE) md1 (ACTIVE) md0 (PASSIVE) # gmultipath fail mm md0 # gmultipath rotate mm;gmultipath status mm Name Status Components multipath/mm DEGRADED md3 (PASSIVE) md2 (ACTIVE) md1 (PASSIVE) md0 (FAIL) # gmultipath rotate mm;gmultipath status mm Name Status Components multipath/mm DEGRADED md3 (PASSIVE) md2 (PASSIVE) md1 (ACTIVE) md0 (FAIL) # gmultipath rotate mm;gmultipath status mm Name Status Components multipath/mm DEGRADED md3 (PASSIVE) md2 (ACTIVE) md1 (PASSIVE) md0 (FAIL) >Fix: Index: sys/geom/multipath/g_multipath.c =================================================================== --- g_multipath.c (révision 239012) +++ g_multipath.c (copie de travail) @@ -590,19 +590,26 @@ static int g_multipath_rotate(struct g_geom *gp) { - struct g_consumer *lcp; + struct g_consumer *lcp, *first_good_cp = NULL; struct g_multipath_softc *sc = gp->softc; + int active_cp_seen = 0; g_topology_assert(); if (sc == NULL) return (ENXIO); LIST_FOREACH(lcp, &gp->consumer, consumer) { if ((lcp->index & MP_BAD) == 0) { - if (sc->sc_active != lcp) + if (first_good_cp == NULL) + first_good_cp = lcp; + if (active_cp_seen) break; } + if (sc->sc_active == lcp) + active_cp_seen = 1; } - if (lcp) { + if (lcp == NULL && first_good_cp != NULL) + lcp = first_good_cp; + if (lcp && lcp != sc->sc_active) { sc->sc_active = lcp; if (sc->sc_active_active != 1) printf("GEOM_MULTIPATH: %s is now active path in %s\n", >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120804222948.ADAF7382A>