summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-05-24 13:10:54 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-05-24 13:10:54 +0000
commit2d9bd9442f5fc77c2564c93b7dbe84ed4bc4c17c (patch)
tree761d51062770a57217f50d73f6a06db0c1628fca
parentf49f20f7f07ad6f9bf167c0982e5a5a56b012ea2 (diff)
Make sure that b_iodone handlers are called at splbio (and splassert(IPL_BIO) in all known callers, just to make sure).
-rw-r--r--sys/dev/ccd.c8
-rw-r--r--sys/dev/vnd.c7
-rw-r--r--sys/uvm/uvm_pager.c8
-rw-r--r--sys/uvm/uvm_pdaemon.c4
-rw-r--r--sys/uvm/uvm_swap.c10
5 files changed, 17 insertions, 20 deletions
diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c
index 99eaf1dcc1c..a07c38f25ed 100644
--- a/sys/dev/ccd.c
+++ b/sys/dev/ccd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ccd.c,v 1.48 2002/05/23 14:28:36 art Exp $ */
+/* $OpenBSD: ccd.c,v 1.49 2002/05/24 13:10:52 art Exp $ */
/* $NetBSD: ccd.c,v 1.33 1996/05/05 04:21:14 thorpej Exp $ */
/*-
@@ -1033,11 +1033,12 @@ ccdiodone(vbp)
int unit = cbp->cb_unit;
struct ccd_softc *cs = &ccd_softc[unit];
int old_io = cbp->cb_flags & CBF_OLD;
- int cbflags, s, i;
+ int cbflags, i;
long count = bp->b_bcount, off;
char *comptype;
- s = splbio();
+ splassert(IPL_BIO);
+
#ifdef DEBUG
if (ccddebug & CCDB_FOLLOW)
printf("ccdiodone(%p)\n", cbp);
@@ -1106,7 +1107,6 @@ ccdiodone(vbp)
if (bp->b_resid == 0)
ccdintr(&ccd_softc[unit], bp);
}
- splx(s);
}
/* ARGSUSED */
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index 1ee913e714c..47b43452833 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnd.c,v 1.33 2002/05/23 22:47:16 art Exp $ */
+/* $OpenBSD: vnd.c,v 1.34 2002/05/24 13:10:52 art Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
@@ -652,9 +652,9 @@ vndiodone(bp)
struct buf *pbp = vbp->vb_obp;
struct vnd_softc *vnd = &vnd_softc[vndunit(pbp->b_dev)];
long count;
- int s;
- s = splbio();
+ splassert(IPL_BIO);
+
#ifdef DEBUG
if (vnddebug & VDB_IO)
printf("vndiodone(%d): vbp %p vp %p blkno %x addr %p cnt %lx\n",
@@ -688,7 +688,6 @@ vndiodone(bp)
else
vnd->sc_tab.b_active--;
}
- splx(s);
}
/* ARGSUSED */
diff --git a/sys/uvm/uvm_pager.c b/sys/uvm/uvm_pager.c
index 0a5ad1f725c..3511cd2ecae 100644
--- a/sys/uvm/uvm_pager.c
+++ b/sys/uvm/uvm_pager.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_pager.c,v 1.31 2002/05/22 14:29:20 art Exp $ */
+/* $OpenBSD: uvm_pager.c,v 1.32 2002/05/24 13:10:53 art Exp $ */
/* $NetBSD: uvm_pager.c,v 1.36 2000/11/27 18:26:41 chs Exp $ */
/*
@@ -794,11 +794,13 @@ uvm_aio_aiodone(bp)
int npages = bp->b_bufsize >> PAGE_SHIFT;
struct vm_page *pg, *pgs[npages];
struct uvm_object *uobj;
- int s, i, error;
+ int i, error;
boolean_t write, swap;
UVMHIST_FUNC("uvm_aio_aiodone"); UVMHIST_CALLED(ubchist);
UVMHIST_LOG(ubchist, "bp %p", bp, 0,0,0);
+ splassert(IPL_BIO);
+
error = (bp->b_flags & B_ERROR) ? (bp->b_error ? bp->b_error : EIO) : 0;
write = (bp->b_flags & B_READ) == 0;
#ifdef UBC
@@ -881,12 +883,10 @@ uvm_aio_aiodone(bp)
#ifdef UVM_SWAP_ENCRYPT
freed:
#endif
- s = splbio();
if (write && (bp->b_flags & B_AGE) != 0 && bp->b_vp != NULL) {
vwakeup(bp->b_vp);
}
pool_put(&bufpool, bp);
- splx(s);
}
/*
diff --git a/sys/uvm/uvm_pdaemon.c b/sys/uvm/uvm_pdaemon.c
index dfa77ec9949..e011f925412 100644
--- a/sys/uvm/uvm_pdaemon.c
+++ b/sys/uvm/uvm_pdaemon.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_pdaemon.c,v 1.24 2002/03/14 01:27:18 millert Exp $ */
+/* $OpenBSD: uvm_pdaemon.c,v 1.25 2002/05/24 13:10:53 art Exp $ */
/* $NetBSD: uvm_pdaemon.c,v 1.23 2000/08/20 10:24:14 bjh21 Exp $ */
/*
@@ -334,7 +334,9 @@ uvm_aiodone_daemon(void *arg)
uvmexp.paging -= bp->b_bufsize >> PAGE_SHIFT;
}
nbp = TAILQ_NEXT(bp, b_freelist);
+ s = splbio(); /* b_iodone must by called at splbio */
(*bp->b_iodone)(bp);
+ splx(s);
bp = nbp;
}
if (free <= uvmexp.reserve_kernel) {
diff --git a/sys/uvm/uvm_swap.c b/sys/uvm/uvm_swap.c
index c5d0ff18a39..380090a2cbc 100644
--- a/sys/uvm/uvm_swap.c
+++ b/sys/uvm/uvm_swap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_swap.c,v 1.52 2002/05/24 08:58:41 art Exp $ */
+/* $OpenBSD: uvm_swap.c,v 1.53 2002/05/24 13:10:53 art Exp $ */
/* $NetBSD: uvm_swap.c,v 1.40 2000/11/17 11:39:39 mrg Exp $ */
/*
@@ -1506,7 +1506,7 @@ sw_reg_iodone(bp)
struct vndxfer *vnx = vbp->vb_xfer;
struct buf *pbp = vnx->vx_bp; /* parent buffer */
struct swapdev *sdp = vnx->vx_sdp;
- int s, resid;
+ int resid;
UVMHIST_FUNC("sw_reg_iodone"); UVMHIST_CALLED(pdhist);
UVMHIST_LOG(pdhist, " vbp=%p vp=%p blkno=%x addr=%p",
@@ -1514,11 +1514,8 @@ sw_reg_iodone(bp)
UVMHIST_LOG(pdhist, " cnt=%lx resid=%lx",
vbp->vb_buf.b_bcount, vbp->vb_buf.b_resid, 0, 0);
- /*
- * protect vbp at splbio and update.
- */
+ splassert(IPL_BIO);
- s = splbio();
resid = vbp->vb_buf.b_bcount - vbp->vb_buf.b_resid;
pbp->b_resid -= resid;
vnx->vx_pending--;
@@ -1570,7 +1567,6 @@ sw_reg_iodone(bp)
*/
sdp->swd_tab.b_active--;
sw_reg_start(sdp);
- splx(s);
}