From owner-freebsd-bugs Fri Jan 7 9:50:10 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from feral.com (feral.com [192.67.166.1]) by hub.freebsd.org (Postfix) with ESMTP id 96127157FC for ; Fri, 7 Jan 2000 09:50:06 -0800 (PST) (envelope-from mjacob@feral.com) Received: from beppo.feral.com (beppo [192.67.166.79]) by feral.com (8.9.3/8.9.3) with ESMTP id JAA22973; Fri, 7 Jan 2000 09:50:03 -0800 Date: Fri, 7 Jan 2000 09:50:01 -0800 (PST) From: Matthew Jacob Reply-To: mjacob@feral.com To: Soren Schmidt Cc: Poul-Henning Kamp , freebsd-bugs@FreeBSD.ORG Subject: Re: kern/15956: Off-by-1 error in diskstrategy() triggers bug in ATA In-Reply-To: <200001071217.NAA83738@freebsd.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Uh- this looks like if not a bug in and of itself, covering another bug. On Fri, 7 Jan 2000, Soren Schmidt wrote: > It seems Poul-Henning Kamp wrote: > > >Index: subr_disk.c > > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > >RCS file: /home/CVSROOT/src/sys/kern/subr_disk.c,v > > >retrieving revision 1.16 > > >diff -u -r1.16 subr_disk.c > > >--- subr_disk.c=091999/12/19 12:36:41=091.16 > > >+++ subr_disk.c=092000/01/06 21:39:34 > > >@@ -193,7 +193,7 @@ > > > =09=09return; > > > =09} > > >=20 > > >-=09if (dscheck(bp, dp->d_slice) < 0) { > > >+=09if (dscheck(bp, dp->d_slice) <=3D 0) { > > > =09=09biodone(bp); > > > =09=09return; > > > =09} > > > > > >=092) Add belt-and-braces checks to ATA device (this code compiles > > >=09 and links, but I haven't booted from the resultant kernel): > > =20 > > This was actually done that way deliberately, but not for any > > specific reason. > > =20 > > Input welcome... >=20 > I've put this in the ata drivers: >=20 > /* if it's a null transfer, return immediatly. */ > if (bp->b_bcount =3D=3D 0) { > bp->b_resid =3D 0; > biodone(bp); > return; > } >=20 > -S=F8ren >=20 >=20 > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-bugs" in the body of the message >=20 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message