From 939b432d02d70b51f4c493b4539d70fc76b85817 Mon Sep 17 00:00:00 2001 From: dg Date: Wed, 18 Nov 1998 09:00:47 +0000 Subject: Closed a very narrow and rare race condition that involved net interrupts, bio interrupts, and a truncated file that along with the precise alignment of the planets could result in a page being freed multiple times or a just-freed page being put onto the inactive queue. --- sys/kern/vfs_bio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/kern/vfs_bio.c') diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 0b5487c..5704558 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.183 1998/10/30 14:53:54 dg Exp $ + * $Id: vfs_bio.c,v 1.184 1998/10/31 15:31:22 peter Exp $ */ /* @@ -788,9 +788,10 @@ static void vfs_vmio_release(bp) struct buf *bp; { - int i; + int i, s; vm_page_t m; + s = splvm(); for (i = 0; i < bp->b_npages; i++) { m = bp->b_pages[i]; bp->b_pages[i] = NULL; @@ -820,6 +821,7 @@ vfs_vmio_release(bp) } } } + splx(s); bufspace -= bp->b_bufsize; vmiospace -= bp->b_bufsize; pmap_qremove(trunc_page((vm_offset_t) bp->b_data), bp->b_npages); -- cgit v1.1