diff options
author | dfr <dfr@FreeBSD.org> | 1998-08-13 08:09:08 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1998-08-13 08:09:08 +0000 |
commit | cb85cf3e66942eabeff656173ac75b9275fa61fe (patch) | |
tree | 0f2c440ae29cf3c8695d77275be9d3ffe4f4a18a /sys | |
parent | a1b2079000fa319fd6e9ee79ceb8d15d4bbd55d5 (diff) | |
download | FreeBSD-src-cb85cf3e66942eabeff656173ac75b9275fa61fe.zip FreeBSD-src-cb85cf3e66942eabeff656173ac75b9275fa61fe.tar.gz |
Protect all modifications to v_numoutput with splbio().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_diskslice.c | 10 | ||||
-rw-r--r-- | sys/kern/vfs_bio.c | 6 | ||||
-rw-r--r-- | sys/kern/vfs_cluster.c | 4 | ||||
-rw-r--r-- | sys/nfs/nfs_vnops.c | 4 | ||||
-rw-r--r-- | sys/nfsclient/nfs_vnops.c | 4 |
5 files changed, 18 insertions, 10 deletions
diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c index 644f136..bdc635e 100644 --- a/sys/kern/subr_diskslice.c +++ b/sys/kern/subr_diskslice.c @@ -43,7 +43,7 @@ * from: wd.c,v 1.55 1994/10/22 01:57:12 phk Exp $ * from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91 * from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $ - * $Id: subr_diskslice.c,v 1.55 1998/07/29 11:15:48 bde Exp $ + * $Id: subr_diskslice.c,v 1.56 1998/07/30 15:16:05 bde Exp $ */ #include "opt_devfs.h" @@ -165,6 +165,7 @@ dscheck(bp, ssp) daddr_t secno; daddr_t slicerel_secno; struct diskslice *sp; + int s; blkno = bp->b_blkno; if (blkno < 0) { @@ -284,8 +285,11 @@ if (labelsect != 0) Debugger("labelsect != 0 in dscheck()"); * XXX probably need to copy the data to avoid even * temporarily corrupting the in-core copy. */ - if (bp->b_vp != NULL) + if (bp->b_vp != NULL) { + s = splbio(); bp->b_vp->v_numoutput++; + splx(s); + } /* XXX need name here. */ msg = fixlabel((char *)NULL, sp, (struct disklabel *) @@ -374,7 +378,7 @@ int dsioctl(dname, dev, cmd, data, flags, sspp, strat, setgeom) char *dname; dev_t dev; - int cmd; + u_long cmd; caddr_t data; int flags; struct diskslices **sspp; diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index e1cb45a..8a759c0 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.167 1998/07/13 07:05:55 bde Exp $ + * $Id: vfs_bio.c,v 1.168 1998/08/06 08:33:18 dfr Exp $ */ /* @@ -366,7 +366,7 @@ breadn(struct vnode * vp, daddr_t blkno, int size, int bwrite(struct buf * bp) { - int oldflags; + int oldflags, s; struct vnode *vp; struct mount *mp; @@ -386,6 +386,7 @@ bwrite(struct buf * bp) bp->b_flags &= ~(B_READ | B_DONE | B_ERROR | B_DELWRI); bp->b_flags |= B_WRITEINPROG; + s = splbio(); if ((oldflags & B_DELWRI) == B_DELWRI) { --numdirtybuffers; reassignbuf(bp, bp->b_vp); @@ -395,6 +396,7 @@ bwrite(struct buf * bp) vfs_busy_pages(bp, 1); if (curproc != NULL) curproc->p_stats->p_ru.ru_oublock++; + splx(s); VOP_STRATEGY(bp->b_vp, bp); /* diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index 94da3f7..3f969ad 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.66 1998/07/29 17:38:14 bde Exp $ + * $Id: vfs_cluster.c,v 1.67 1998/08/06 08:33:18 dfr Exp $ */ #include "opt_debug_cluster.h" @@ -798,11 +798,13 @@ cluster_wbuild(vp, size, start_lbn, len) bp->b_bcount += size; bp->b_bufsize += size; + s = splbio(); --numdirtybuffers; tbp->b_flags &= ~(B_READ | B_DONE | B_ERROR | B_DELWRI); tbp->b_flags |= B_ASYNC; reassignbuf(tbp, tbp->b_vp); /* put on clean list */ ++tbp->b_vp->v_numoutput; + splx(s); TAILQ_INSERT_TAIL(&bp->b_cluster.cluster_head, tbp, b_cluster.cluster_entry); } diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 965d85e..385f6f6 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 - * $Id: nfs_vnops.c,v 1.104 1998/06/01 10:59:23 peter Exp $ + * $Id: nfs_vnops.c,v 1.105 1998/07/04 20:45:37 julian Exp $ */ @@ -2853,6 +2853,7 @@ again: vfs_unbusy_pages(bp); brelse(bp); } else { + s = splbio(); /* XXX check this positionning */ vp->v_numoutput++; bp->b_flags |= B_ASYNC; if (bp->b_flags & B_DELWRI) { @@ -2861,7 +2862,6 @@ again: vfs_bio_need_satisfy(); } } - s = splbio(); /* XXX check this positionning */ bp->b_flags &= ~(B_READ|B_DONE|B_ERROR|B_DELWRI); bp->b_dirtyoff = bp->b_dirtyend = 0; reassignbuf(bp, vp); diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 965d85e..385f6f6 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 - * $Id: nfs_vnops.c,v 1.104 1998/06/01 10:59:23 peter Exp $ + * $Id: nfs_vnops.c,v 1.105 1998/07/04 20:45:37 julian Exp $ */ @@ -2853,6 +2853,7 @@ again: vfs_unbusy_pages(bp); brelse(bp); } else { + s = splbio(); /* XXX check this positionning */ vp->v_numoutput++; bp->b_flags |= B_ASYNC; if (bp->b_flags & B_DELWRI) { @@ -2861,7 +2862,6 @@ again: vfs_bio_need_satisfy(); } } - s = splbio(); /* XXX check this positionning */ bp->b_flags &= ~(B_READ|B_DONE|B_ERROR|B_DELWRI); bp->b_dirtyoff = bp->b_dirtyend = 0; reassignbuf(bp, vp); |