From owner-freebsd-current Wed Jan 20 12:24:07 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA13428 for freebsd-current-outgoing; Wed, 20 Jan 1999 12:24:07 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA13422 for ; Wed, 20 Jan 1999 12:24:06 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.2/8.9.1) id MAA06937; Wed, 20 Jan 1999 12:23:59 -0800 (PST) (envelope-from dillon) Date: Wed, 20 Jan 1999 12:23:59 -0800 (PST) From: Matthew Dillon Message-Id: <199901202023.MAA06937@apollo.backplane.com> To: Bjoern Fischer , current@FreeBSD.ORG Subject: Re: panic: vinvalbuf: dirty bufs (during reboot, several times) References: <19990120073445.A402@titan.klemm.gtn.com> <199901200700.XAA76802@apollo.backplane.com> <19990120132700.A15521@voliere.TechFak.Uni-Bielefeld.DE> <199901201923.LAA05838@apollo.backplane.com> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Try this. In nfs_bioread(), nfs/nfs_bio.c: Before, it was: if (getpages && !(bp->b_flags & B_VMIO)) { #ifdef DIAGNOSTIC printf("nfs_bioread: non vmio buf found, discarding\n"); Try changin the if() to this: if ( (getpages && !(bp->b_flags & B_VMIO)) || (bp->b_flags & (B_CACHE|B_DELWRI)) == B_DELWRI ) { #ifdef DIAGNOSTIC printf("nfs_bioread: non vmio buf found, discarding\n"); #endif I believe what is going on is that bioread() is misinterpreting B_CACHE to mean that it can discard the entire buffer. If B_DELWRI is set, however, it must sync the buffer first. What is occuring is that when a program write()'s non-contiguously and then lseek's back and read()'s again, B_CACHE is getting cleared and the buffer is being re-read from NFS without first being flushed to NFS, causing the written data to be overwritten by the read. I have NOT tested this well. It seems to solve the vi SEG fault problem. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message