Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Dec 2008 14:32:39 +0000 (UTC)
From:      Ulf Lilleengen <lulf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r186517 - head/sys/geom/vinum
Message-ID:  <200812271432.mBREWd6D073903@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lulf
Date: Sat Dec 27 14:32:39 2008
New Revision: 186517
URL: http://svn.freebsd.org/changeset/base/186517

Log:
  - Fix an issue with access permissions to underlying disks used by a gvinum
    plex. If the plex is a raid5 plex, and is being written to, parity data might
    have to be read from the underlying disks, requiring them to be opened for
    reading as well as writing.
  
  MFC after:	1 week

Modified:
  head/sys/geom/vinum/geom_vinum_plex.c

Modified: head/sys/geom/vinum/geom_vinum_plex.c
==============================================================================
--- head/sys/geom/vinum/geom_vinum_plex.c	Sat Dec 27 14:24:24 2008	(r186516)
+++ head/sys/geom/vinum/geom_vinum_plex.c	Sat Dec 27 14:32:39 2008	(r186517)
@@ -663,11 +663,21 @@ gv_plex_normal_request(struct gv_plex *p
 static int
 gv_plex_access(struct g_provider *pp, int dr, int dw, int de)
 {
+	struct gv_plex *p;
 	struct g_geom *gp;
 	struct g_consumer *cp, *cp2;
 	int error;
 
 	gp = pp->geom;
+	p = gp->softc;
+	KASSERT(p != NULL, ("NULL p"));
+
+	if (p->org == GV_PLEX_RAID5) {
+		if (dw > 0 && dr == 0)
+			dr = 1;
+		else if (dw < 0 && dr == 0)
+			dr = -1;
+	}
 
 	LIST_FOREACH(cp, &gp->consumer, consumer) {
 		error = g_access(cp, dr, dw, de);



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