Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Jan 2000 15:50:02 -0800 (PST)
From:      Peter Jeremy <peter.jeremy@alcatel.com.au>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/15956: Off-by-1 error in diskstrategy() triggers bug in ATA
Message-ID:  <200001092350.PAA35697@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/15956; it has been noted by GNATS.

From: Peter Jeremy <peter.jeremy@alcatel.com.au>
To: Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/15956: Off-by-1 error in diskstrategy() triggers bug in ATA
Date: Mon, 10 Jan 2000 10:39:40 +1100

 On 2000-Jan-07 22:57:11 +1100, Poul-Henning Kamp <phk@critter.freebsd.dk> wrote:
 >>-	if (dscheck(bp, dp->d_slice) < 0) {
 >>+	if (dscheck(bp, dp->d_slice) <= 0) {
 ...
 >This was actually done that way deliberately, but not for any
 >specific reason.
 
 I wasn't sure about the reasons.  What I did notice was that the other
 references to dscheck() all do a <= check:
 
 /sys/dev/ida/ida_disk.c:205:        if (dscheck(bp, drv->slices) <= 0)
 /sys/dev/vn/vn.c:305:               if (vn->sc_slices != NULL && dscheck(bp, vn->sc_slices) <= 0) {
 /sys/i386/isa/wd.c:581:     if (dscheck(bp, du->dk_slices) <= 0)
 /sys/i386/isa/wfd.c:419:    if (dscheck(bp, t->dk_slices) <= 0) {
 /sys/pc98/pc98/wd.c:675:    if (dscheck(bp, du->dk_slices) <= 0)
 
 Also, I can't see any point in passing zero-length I/O requests into
 the low level drivers - bouncing them back out as quick as possible
 will (if anything) improve performance.
 
 I notice Soren has since added a (correct, unlike mine) patch to
 the ata drivers to catch zero-length requests.
 
 Peter
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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