summaryrefslogtreecommitdiffstats
path: root/sys/geom/vinum
diff options
context:
space:
mode:
authorlulf <lulf@FreeBSD.org>2008-12-27 14:32:39 +0000
committerlulf <lulf@FreeBSD.org>2008-12-27 14:32:39 +0000
commit55553856e4033b18b0bd9ae14765702aabbdcb9e (patch)
tree342f08a1031cb756e2b8c04511feefe9f5a0fd46 /sys/geom/vinum
parent798a67faaf8e9dcd2de64cbb2a517a1d4598f960 (diff)
downloadFreeBSD-src-55553856e4033b18b0bd9ae14765702aabbdcb9e.zip
FreeBSD-src-55553856e4033b18b0bd9ae14765702aabbdcb9e.tar.gz
- 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
Diffstat (limited to 'sys/geom/vinum')
-rw-r--r--sys/geom/vinum/geom_vinum_plex.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/geom/vinum/geom_vinum_plex.c b/sys/geom/vinum/geom_vinum_plex.c
index 424e95a..8281cb2 100644
--- a/sys/geom/vinum/geom_vinum_plex.c
+++ b/sys/geom/vinum/geom_vinum_plex.c
@@ -663,11 +663,21 @@ gv_plex_normal_request(struct gv_plex *p, struct bio *bp)
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);
OpenPOWER on IntegriCloud