summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1998-11-18 09:00:47 +0000
committerdg <dg@FreeBSD.org>1998-11-18 09:00:47 +0000
commit939b432d02d70b51f4c493b4539d70fc76b85817 (patch)
tree9c19c39d996b0b6fcbe33ab03ffc075886f90908 /sys/kern/vfs_bio.c
parentfeaedfaff603933e7dba04b2b6a7009f4251c507 (diff)
downloadFreeBSD-src-939b432d02d70b51f4c493b4539d70fc76b85817.zip
FreeBSD-src-939b432d02d70b51f4c493b4539d70fc76b85817.tar.gz
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.
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r--sys/kern/vfs_bio.c6
1 files changed, 4 insertions, 2 deletions
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);
OpenPOWER on IntegriCloud