Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jan 2009 11:24:15 +0000 (UTC)
From:      Ulf Lilleengen <lulf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r187140 - projects/gvinum/sys/geom/vinum
Message-ID:  <200901131124.n0DBOFwU002165@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lulf
Date: Tue Jan 13 11:24:14 2009
New Revision: 187140
URL: http://svn.freebsd.org/changeset/base/187140

Log:
  - In the case of a volume in the up state but all plexes down (the state must
    have been forced by the user), avoid looping infinately while trying out all
    plexes, which are down.

Modified:
  projects/gvinum/sys/geom/vinum/geom_vinum_volume.c

Modified: projects/gvinum/sys/geom/vinum/geom_vinum_volume.c
==============================================================================
--- projects/gvinum/sys/geom/vinum/geom_vinum_volume.c	Tue Jan 13 10:59:54 2009	(r187139)
+++ projects/gvinum/sys/geom/vinum/geom_vinum_volume.c	Tue Jan 13 11:24:14 2009	(r187140)
@@ -43,6 +43,7 @@ gv_volume_start(struct gv_softc *sc, str
 	struct g_geom *gp;
 	struct gv_volume *v;
 	struct gv_plex *p, *lp;
+	int numwrites;
 
 	gp = sc->geom;
 	v = bp->bio_to->private;
@@ -69,8 +70,10 @@ gv_volume_start(struct gv_softc *sc, str
 			lp = LIST_FIRST(&v->plexes);
 		p = LIST_NEXT(lp, in_volume);
 		do {
-			if (p == NULL)
-				p = LIST_FIRST(&v->plexes);
+			if (p == NULL) {
+				p = lp;
+				break;
+			}
 			if ((p->state > GV_PLEX_DEGRADED) ||
 			    (p->state >= GV_PLEX_DEGRADED &&
 			    p->org == GV_PLEX_RAID5))
@@ -100,12 +103,16 @@ gv_volume_start(struct gv_softc *sc, str
 			}
 		}
 
+		numwrites = 0;
 		/* Give the BIO to each plex of this volume. */
 		LIST_FOREACH(p, &v->plexes, in_volume) {
 			if (p->state < GV_PLEX_DEGRADED)
 				continue;
 			gv_plex_start(p, bp);
+			numwrites++;
 		}
+		if (numwrites == 0)
+			g_io_deliver(bp, ENXIO);
 		break;
 	}
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901131124.n0DBOFwU002165>