Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jan 1999 12:23:59 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Bjoern Fischer <bfischer@TechFak.Uni-Bielefeld.DE>, current@FreeBSD.ORG
Subject:   Re: panic: vinvalbuf: dirty bufs (during reboot, several times)
Message-ID:  <199901202023.MAA06937@apollo.backplane.com>
References:  <19990120073445.A402@titan.klemm.gtn.com> <199901200700.XAA76802@apollo.backplane.com> <19990120132700.A15521@voliere.TechFak.Uni-Bielefeld.DE> <199901201923.LAA05838@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
    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 
					<dillon@backplane.com>


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



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