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_cluster.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_cluster.c')
-rw-r--r-- | sys/kern/vfs_cluster.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index 0ab55fa..94da3f7 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -33,7 +33,7 @@ * SUCH DAMAGE. * * @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94 - * $Id: vfs_cluster.c,v 1.65 1998/07/11 10:45:45 bde Exp $ + * $Id: vfs_cluster.c,v 1.66 1998/07/29 17:38:14 bde Exp $ */ #include "opt_debug_cluster.h" @@ -309,7 +309,7 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp) { struct buf *bp, *tbp; daddr_t bn; - int i, inc, j; + int i, inc, j, s; #ifdef DIAGNOSTIC if (size != vp->v_mount->mnt_stat.f_iosize) @@ -417,8 +417,10 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp) for (j = 0; j < tbp->b_npages; j += 1) { vm_page_t m; m = tbp->b_pages[j]; + s = splvm(); ++m->busy; ++m->object->paging_in_progress; + splx(s); if ((bp->b_npages == 0) || (bp->b_pages[bp->b_npages-1] != m)) { bp->b_pages[bp->b_npages] = m; @@ -782,8 +784,10 @@ cluster_wbuild(vp, size, start_lbn, len) for (j = 0; j < tbp->b_npages; j += 1) { m = tbp->b_pages[j]; + s = splvm(); ++m->busy; ++m->object->paging_in_progress; + splx(s); if ((bp->b_npages == 0) || (bp->b_pages[bp->b_npages - 1] != m)) { bp->b_pages[bp->b_npages] = m; |