diff options
author | dg <dg@FreeBSD.org> | 1994-12-23 04:52:55 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1994-12-23 04:52:55 +0000 |
commit | cf154a213447be505c0b2f3e9fde40ad88b8a5ec (patch) | |
tree | a69d867aad840750ffaf0105c58833bb56f1e62b | |
parent | cd866e52ae687ceafe7d06b67adabbabfc8a47a4 (diff) | |
download | FreeBSD-src-cf154a213447be505c0b2f3e9fde40ad88b8a5ec.zip FreeBSD-src-cf154a213447be505c0b2f3e9fde40ad88b8a5ec.tar.gz |
Protect vnode buffer chain manipulation with splbio to prevent list
corruption..
-rw-r--r-- | sys/kern/vfs_export.c | 9 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 9 |
2 files changed, 16 insertions, 2 deletions
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index 6713c73..b749976 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94 - * $Id: vfs_subr.c,v 1.11 1994/10/05 09:48:22 davidg Exp $ + * $Id: vfs_subr.c,v 1.12 1994/10/06 21:06:37 davidg Exp $ */ /* @@ -521,6 +521,7 @@ bgetvp(vp, bp) register struct vnode *vp; register struct buf *bp; { + int s; if (bp->b_vp) panic("bgetvp: not free"); @@ -533,7 +534,9 @@ bgetvp(vp, bp) /* * Insert onto list for new vnode. */ + s = splbio(); bufinsvn(bp, &vp->v_cleanblkhd); + splx(s); } /* @@ -544,14 +547,18 @@ brelvp(bp) register struct buf *bp; { struct vnode *vp; + int s; if (bp->b_vp == (struct vnode *) 0) panic("brelvp: NULL"); /* * Delete from old vnode list, if on one. */ + s = splbio(); if (bp->b_vnbufs.le_next != NOLIST) bufremvn(bp); + splx(s); + vp = bp->b_vp; bp->b_vp = (struct vnode *) 0; HOLDRELE(vp); diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 6713c73..b749976 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94 - * $Id: vfs_subr.c,v 1.11 1994/10/05 09:48:22 davidg Exp $ + * $Id: vfs_subr.c,v 1.12 1994/10/06 21:06:37 davidg Exp $ */ /* @@ -521,6 +521,7 @@ bgetvp(vp, bp) register struct vnode *vp; register struct buf *bp; { + int s; if (bp->b_vp) panic("bgetvp: not free"); @@ -533,7 +534,9 @@ bgetvp(vp, bp) /* * Insert onto list for new vnode. */ + s = splbio(); bufinsvn(bp, &vp->v_cleanblkhd); + splx(s); } /* @@ -544,14 +547,18 @@ brelvp(bp) register struct buf *bp; { struct vnode *vp; + int s; if (bp->b_vp == (struct vnode *) 0) panic("brelvp: NULL"); /* * Delete from old vnode list, if on one. */ + s = splbio(); if (bp->b_vnbufs.le_next != NOLIST) bufremvn(bp); + splx(s); + vp = bp->b_vp; bp->b_vp = (struct vnode *) 0; HOLDRELE(vp); |