diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-12-16 21:21:26 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-12-16 21:21:26 +0000 |
commit | ec38494e3ad6f3c1dd69e191cf19f8015a2cf7b3 (patch) | |
tree | 0e4cd0b7f7eb468d750a9df7ead4c5580a7a1b05 /sys/ufs/mfs/mfs_vnops.c | |
parent | cea912f1d50bba2f837b3a5d588cc238c779d84e (diff) |
fix remaining cases of potential concurrent mfs_buflist access;
ok deraadt@ millert@
Diffstat (limited to 'sys/ufs/mfs/mfs_vnops.c')
-rw-r--r-- | sys/ufs/mfs/mfs_vnops.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/ufs/mfs/mfs_vnops.c b/sys/ufs/mfs/mfs_vnops.c index f9dd66574d3..317d4759f73 100644 --- a/sys/ufs/mfs/mfs_vnops.c +++ b/sys/ufs/mfs/mfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfs_vnops.c,v 1.31 2007/12/06 21:49:37 otto Exp $ */ +/* $OpenBSD: mfs_vnops.c,v 1.32 2007/12/16 21:21:25 otto Exp $ */ /* $NetBSD: mfs_vnops.c,v 1.8 1996/03/17 02:16:32 christos Exp $ */ /* @@ -216,13 +216,20 @@ mfs_close(void *v) struct vnode *vp = ap->a_vp; struct mfsnode *mfsp = VTOMFS(vp); struct buf *bp; - int error; + int error, s; /* * Finish any pending I/O requests. */ - while ((bp = mfsp->mfs_buflist) != NULL) { + while (1) { + s = splbio(); + bp = mfsp->mfs_buflist; + if (bp == NULL) { + splx(s); + break; + } mfsp->mfs_buflist = bp->b_actf; + splx(s); mfs_doio(mfsp, bp); wakeup((caddr_t)bp); } |