Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Jan 2000 09:50:01 -0800 (PST)
From:      Matthew Jacob <mjacob@feral.com>
To:        Soren Schmidt <sos@freebsd.dk>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, freebsd-bugs@FreeBSD.ORG
Subject:   Re: kern/15956: Off-by-1 error in diskstrategy() triggers bug in ATA
Message-ID:  <Pine.BSF.4.10.10001070948550.8867-100000@beppo.feral.com>
In-Reply-To: <200001071217.NAA83738@freebsd.dk>

index | next in thread | previous in thread | raw e-mail


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
> >  >===================================================================
> >  >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	1999/12/19 12:36:41	1.16
> >  >+++ subr_disk.c	2000/01/06 21:39:34
> >  >@@ -193,7 +193,7 @@
> >  > 		return;
> >  > 	}
> >  > 
> >  >-	if (dscheck(bp, dp->d_slice) < 0) {
> >  >+	if (dscheck(bp, dp->d_slice) <= 0) {
> >  > 		biodone(bp);
> >  > 		return;
> >  > 	}
> >  >
> >  >	2) Add belt-and-braces checks to ATA device (this code compiles
> >  >	   and links, but I haven't booted from the resultant kernel):
> >  
> >  This was actually done that way deliberately, but not for any
> >  specific reason.
> >  
> >  Input welcome...
> 
> I've put this in the ata drivers:
> 
>     /* if it's a null transfer, return immediatly. */
>     if (bp->b_bcount == 0) {
>         bp->b_resid = 0;
>         biodone(bp);
>         return;
>     }
> 
> -Søren
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-bugs" in the body of the message
> 



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



help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10001070948550.8867-100000>