From owner-freebsd-fs Wed Apr 4 23:26:37 2001 Delivered-To: freebsd-fs@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 80B2A37B43F for ; Wed, 4 Apr 2001 23:26:33 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id QAA23666; Thu, 5 Apr 2001 16:26:23 +1000 Date: Thu, 5 Apr 2001 16:25:08 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Terry Lambert Cc: "Matthew H. North" , freebsd-fs@FreeBSD.ORG Subject: Re: Reproducible kernel panics in ffs_valloc: dup_alloc In-Reply-To: <200104050045.RAA03573@usr08.primenet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Thu, 5 Apr 2001, Terry Lambert wrote: > > Thanks for the help. However, from my understanding of C, that patch does > > nothing (except add an extra instruction or two to the kernel). It simply > > adds an extra OR condition, that is always false, to an if statement. > > > > if CONDITION then > > do something > > > > is exactly the same as > > > > if FALSE or CONDITION then > > do something > > > > Perhaps I'm missing something. If so, please let me know. > > I think he meant "&&" instead of "||", which then dikes the code out. Yes. Oops. I actually use a 150 line version of the patch, with checks that vfs_bio_clrbuf() actually cleared the buffer and code to recover when it doesn't Corrected version of the quick fix: Index: vfs_bio.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_bio.c,v retrieving revision 1.273 diff -u -2 -r1.273 vfs_bio.c --- vfs_bio.c 2001/02/28 04:13:07 1.273 +++ vfs_bio.c 2001/04/05 06:24:29 @@ -3088,5 +3088,5 @@ int i, mask = 0; caddr_t sa, ea; - if ((bp->b_flags & (B_VMIO | B_MALLOC)) == B_VMIO) { + if (0 && (bp->b_flags & (B_VMIO | B_MALLOC)) == B_VMIO) { bp->b_flags &= ~B_INVAL; bp->b_ioflags &= ~BIO_ERROR; Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message