From owner-svn-src-head@FreeBSD.ORG Sat Jul 18 11:12:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E364F1065672; Sat, 18 Jul 2009 11:12:48 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D14648FC13; Sat, 18 Jul 2009 11:12:48 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6IBCmad000107; Sat, 18 Jul 2009 11:12:48 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6IBCmH6000105; Sat, 18 Jul 2009 11:12:48 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200907181112.n6IBCmH6000105@svn.freebsd.org> From: Ulf Lilleengen Date: Sat, 18 Jul 2009 11:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195752 - head/sys/geom/vinum X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jul 2009 11:12:49 -0000 Author: lulf Date: Sat Jul 18 11:12:48 2009 New Revision: 195752 URL: http://svn.freebsd.org/changeset/base/195752 Log: - 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) Modified: head/sys/geom/vinum/geom_vinum.c Modified: head/sys/geom/vinum/geom_vinum.c ============================================================================== --- head/sys/geom/vinum/geom_vinum.c Sat Jul 18 10:36:18 2009 (r195751) +++ head/sys/geom/vinum/geom_vinum.c Sat Jul 18 11:12:48 2009 (r195752) @@ -133,10 +133,12 @@ gv_access(struct g_provider *pp, int dr, 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;