diff options
author | dfr <dfr@FreeBSD.org> | 1998-08-06 08:33:19 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1998-08-06 08:33:19 +0000 |
commit | 0864bef6791e1818c64fa41c0eb3e69ffe0066d9 (patch) | |
tree | 7d9411f07b566d86fd0730872a748080ff8a6d8b /sys/kern/vfs_bio.c | |
parent | 203de4af5d0b4c199f18b2451ea9b044b2c8a6b2 (diff) | |
download | FreeBSD-src-0864bef6791e1818c64fa41c0eb3e69ffe0066d9.zip FreeBSD-src-0864bef6791e1818c64fa41c0eb3e69ffe0066d9.tar.gz |
Protect all modifications to paging_in_progress with splvm(). The i386
managed to avoid corruption of this variable by luck (the compiler used a
memory read-modify-write instruction which wasn't interruptable) but other
architectures cannot.
With this change, I am now able to 'make buildworld' on the alpha (sfx: the
crowd goes wild...)
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r-- | sys/kern/vfs_bio.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index ee0e53c..e1cb45a 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.166 1998/07/08 01:04:27 julian Exp $ + * $Id: vfs_bio.c,v 1.167 1998/07/13 07:05:55 bde Exp $ */ /* @@ -2104,7 +2104,7 @@ SYSCTL_PROC(_kern, KERN_UPDATEINTERVAL, update, CTLTYPE_INT|CTLFLAG_RW, void vfs_unbusy_pages(struct buf * bp) { - int i; + int i, s; if (bp->b_flags & B_VMIO) { struct vnode *vp = bp->b_vp; @@ -2123,7 +2123,9 @@ vfs_unbusy_pages(struct buf * bp) bp->b_pages[i] = m; pmap_qenter(trunc_page(bp->b_data), bp->b_pages, bp->b_npages); } + s = splvm(); --obj->paging_in_progress; + splx(s); m->flags &= ~PG_ZERO; PAGE_BWAKEUP(m); } @@ -2221,7 +2223,7 @@ vfs_page_set_valid(struct buf *bp, vm_ooffset_t off, int pageno, vm_page_t m) void vfs_busy_pages(struct buf * bp, int clear_modify) { - int i,s; + int i, s; if (bp->b_flags & B_VMIO) { struct vnode *vp = bp->b_vp; @@ -2248,7 +2250,9 @@ retry: m->flags &= ~PG_ZERO; if ((bp->b_flags & B_CLUSTER) == 0) { + s = splvm(); obj->paging_in_progress++; + splx(s); m->busy++; } |