mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Protect all modifications to v_numoutput with splbio().
This commit is contained in:
parent
196e9a52ec
commit
7032ad107e
5 changed files with 18 additions and 10 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue