diff options
author | dg <dg@FreeBSD.org> | 1995-04-16 05:11:14 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-04-16 05:11:14 +0000 |
commit | 1c003ae427321a408dd238bb42a721a80e38eb2f (patch) | |
tree | 087cb5b438c214fa5f951efcf25c10db82cd203b | |
parent | 4fbcb344548df8b562a4e2fe1ce9dca7067fdcc3 (diff) | |
download | FreeBSD-src-1c003ae427321a408dd238bb42a721a80e38eb2f.zip FreeBSD-src-1c003ae427321a408dd238bb42a721a80e38eb2f.tar.gz |
1) Check for curproc != NULL in bread/bwrite. John convinced me that this
is necessary in order for panic+sync to work. Will also gloss over a panic
that Jordan was having with the install floppies that remains unexplainable.
2) Handle "bogus_page" a little better.
3) Set page protection to VM_PROT_NONE if the entire page has become !valid.
Submitted by: John Dyson (2&3), me (1).
-rw-r--r-- | sys/kern/vfs_bio.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index c39d3bb..da4bcb3 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -18,7 +18,7 @@ * 5. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: vfs_bio.c,v 1.38 1995/03/27 00:11:45 davidg Exp $ + * $Id: vfs_bio.c,v 1.39 1995/04/09 06:02:43 davidg Exp $ */ /* @@ -402,7 +402,12 @@ brelse(struct buf * bp) for (i = 0; i < bp->b_npages; i++) { m = bp->b_pages[i]; if (m == bogus_page) { - panic("brelse: bogus page found"); + m = vm_page_lookup(obj, foff); + if (!m) { + panic("brelse: page missing\n"); + } + bp->b_pages[i] = m; + pmap_qenter(trunc_page(bp->b_data), bp->b_pages, bp->b_npages); } resid = (m->offset + PAGE_SIZE) - foff; if (resid > iototal) @@ -410,6 +415,8 @@ brelse(struct buf * bp) if (resid > 0) { if (bp->b_flags & (B_ERROR | B_NOCACHE)) { vm_page_set_invalid(m, foff, resid); + if (m->valid == 0) + vm_page_protect(m, VM_PROT_NONE); } } foff += resid; @@ -736,7 +743,7 @@ loop: #if defined(VFS_BIO_DEBUG) printf("getblk: invalid buffer size: %ld\n", bp->b_bcount); #endif - bp->b_flags |= B_INVAL; + bp->b_flags |= B_NOCACHE; (void) VOP_BWRITE(bp); goto loop; } |