diff options
-rw-r--r-- | sys/kern/vfs_bio.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index a6a525a..09e3afb 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -11,7 +11,7 @@ * 2. Absolutely no warranty of function or purpose is made by the author * John S. Dyson. * - * $Id: vfs_bio.c,v 1.176 1998/09/15 10:05:18 gibbs Exp $ + * $Id: vfs_bio.c,v 1.177 1998/09/25 17:34:49 peter Exp $ */ /* @@ -595,6 +595,19 @@ brelse(struct buf * bp) } /* + * We must clear B_RELBUF if B_DELWRI is set. If vfs_vmio_release() + * is called with B_DELWRI set, the underlying pages may wind up + * getting freed causing a previous write (bdwrite()) to get 'lost' + * because pages associated with a B_DELWRI bp are marked clean. + * + * We still allow the B_INVAL case to call vfs_vmio_release(), even + * if B_DELWRI is set. + */ + + if (bp->b_flags & B_DELWRI) + bp->b_flags &= ~B_RELBUF; + + /* * VMIO buffer rundown. It is not very necessary to keep a VMIO buffer * constituted, so the B_INVAL flag is used to *invalidate* the buffer, * but the VM object is kept around. The B_NOCACHE flag is used to |