aboutsummaryrefslogtreecommitdiff
path: root/sys/geom
diff options
context:
space:
mode:
authorUlf Lilleengen <lulf@FreeBSD.org>2009-07-18 11:12:48 +0000
committerUlf Lilleengen <lulf@FreeBSD.org>2009-07-18 11:12:48 +0000
commitb79cac0f921c231afcebd705eb1580ac49166fce (patch)
treea20fccbb1949294ea53fb82b73956a651ebe9b86 /sys/geom
parentda1b35844b39c625a04c72bd2a10a4d50cfd8edc (diff)
downloadsrc-b79cac0f921c231afcebd705eb1580ac49166fce.tar.gz
src-b79cac0f921c231afcebd705eb1580ac49166fce.zip
- Fix the issue with read access count modification on RAID-5 plexes properly.
If the access counts were not increased and decreased in equal numbers by gvinum consumers, the read access count would be inconsistent with the write access count. Instead, modify the read access count with the write access count directly to prevent any inconsistencies. Approved by: re (kib)
Notes
Notes: svn path=/head/; revision=195752
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/vinum/geom_vinum.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/geom/vinum/geom_vinum.c b/sys/geom/vinum/geom_vinum.c
index f97c8cfcc7dd..7b730bde00b7 100644
--- a/sys/geom/vinum/geom_vinum.c
+++ b/sys/geom/vinum/geom_vinum.c
@@ -133,10 +133,12 @@ gv_access(struct g_provider *pp, int dr, int dw, int de)
error = ENXIO;
gp = pp->geom;
sc = gp->softc;
- if (dw > 0 && dr == 0)
- dr = 1;
- else if (dw < 0 && dr == 0)
- dr = -1;
+ /*
+ * We want to modify the read count with the write count in case we have
+ * plexes in a RAID-5 organization.
+ */
+ dr += dw;
+
LIST_FOREACH(d, &sc->drives, drive) {
if (d->consumer == NULL)
continue;