summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-05-21 21:07:10 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-05-21 21:07:10 +0000
commit8f70ed6c96254a3a3a3ddc4cca2de7486846f2c7 (patch)
tree582efe51b01860cd4371ebcb92bf3cbd59522a37 /sys
parentd1b065d68012800c2340ac8ca18b2695aec1ce9e (diff)
Protect calls to biodone with splbio. Some functions called
by biodone assume splbio (probably just on other filesystems) and some callbacks from b_iodone assume it too. It's just much safer. costa@ ok.
Diffstat (limited to 'sys')
-rw-r--r--sys/nfs/nfs_bio.c6
-rw-r--r--sys/nfs/nfs_vnops.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c
index 19e870622a1..3bdea53c9c0 100644
--- a/sys/nfs/nfs_bio.c
+++ b/sys/nfs/nfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_bio.c,v 1.35 2002/02/08 08:20:49 csapuntz Exp $ */
+/* $OpenBSD: nfs_bio.c,v 1.36 2002/05/21 21:07:09 art Exp $ */
/* $NetBSD: nfs_bio.c,v 1.25.4.2 1996/07/08 20:47:04 jtc Exp $ */
/*
@@ -565,8 +565,8 @@ nfs_asyncio(bp)
*/
s = splbio();
buf_dirty(bp);
- splx(s);
biodone(bp);
+ splx(s);
return (0);
}
@@ -726,6 +726,8 @@ nfs_doio(bp, p)
bp->b_resid = uiop->uio_resid;
if (must_commit)
nfs_clearcommit(vp->v_mount);
+ s = splbio();
biodone(bp);
+ splx(s);
return (error);
}
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 442c33843bd..e79fd9c224c 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vnops.c,v 1.50 2002/03/14 01:27:13 millert Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.51 2002/05/21 21:07:09 art Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
@@ -2737,8 +2737,8 @@ again:
bp->b_flags |= B_ASYNC;
bp->b_flags &= ~(B_READ|B_DONE|B_ERROR);
bp->b_dirtyoff = bp->b_dirtyend = 0;
- splx(s);
biodone(bp);
+ splx(s);
}
}
}
@@ -2940,7 +2940,9 @@ nfs_writebp(bp, force)
if (!retv) {
bp->b_dirtyoff = bp->b_dirtyend = 0;
bp->b_flags &= ~B_NEEDCOMMIT;
+ s = splbio();
biodone(bp);
+ splx(s);
} else if (retv == NFSERR_STALEWRITEVERF)
nfs_clearcommit(bp->b_vp->v_mount);
}