summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-05-23 22:47:17 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-05-23 22:47:17 +0000
commite392949b0fd15bb97d0508f93ac8576a30ae460c (patch)
tree6e9c248ed1d4dc4d9ae5d324eabd740b1c782f42 /sys/dev
parent870db6684e090e4c4aa04d6e26e8d848e57ff63c (diff)
Protect biodone calls with splbio.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ramdisk.c8
-rw-r--r--sys/dev/vnd.c12
2 files changed, 18 insertions, 2 deletions
diff --git a/sys/dev/ramdisk.c b/sys/dev/ramdisk.c
index 4d6dfe450bb..aaf2f2d45bd 100644
--- a/sys/dev/ramdisk.c
+++ b/sys/dev/ramdisk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ramdisk.c,v 1.18 2002/03/14 01:26:52 millert Exp $ */
+/* $OpenBSD: ramdisk.c,v 1.19 2002/05/23 22:47:16 art Exp $ */
/* $NetBSD: ramdisk.c,v 1.8 1996/04/12 08:30:09 leo Exp $ */
/*
@@ -325,6 +325,7 @@ rdstrategy(bp)
struct rd_softc *sc;
caddr_t addr;
size_t off, xfer;
+ int s;
unit = DISKUNIT(bp->b_dev);
sc = ramdisk_devs[unit];
@@ -372,7 +373,9 @@ rdstrategy(bp)
bp->b_flags |= B_ERROR;
break;
}
+ s = splbio();
biodone(bp);
+ splx(s);
}
int
@@ -587,6 +590,7 @@ rd_server_loop(sc)
size_t off; /* offset into "device" */
size_t xfer; /* amount to transfer */
int error;
+ int s;
for (;;) {
/* Wait for some work to arrive. */
@@ -627,7 +631,9 @@ rd_server_loop(sc)
bp->b_error = error;
bp->b_flags |= B_ERROR;
}
+ s = splbio();
biodone(bp);
+ splx(s);
}
}
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index 8ea730211cc..1ee913e714c 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnd.c,v 1.32 2002/03/14 01:26:52 millert Exp $ */
+/* $OpenBSD: vnd.c,v 1.33 2002/05/23 22:47:16 art Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
@@ -410,7 +410,9 @@ vndstrategy(bp)
if ((vnd->sc_flags & VNF_INITED) == 0) {
bp->b_error = ENXIO;
bp->b_flags |= B_ERROR;
+ s = splbio();
biodone(bp);
+ splx(s);
return;
}
@@ -420,13 +422,17 @@ vndstrategy(bp)
if (bn < 0) {
bp->b_error = EINVAL;
bp->b_flags |= B_ERROR;
+ s = splbio();
biodone(bp);
+ splx(s);
return;
}
if (DISKPART(bp->b_dev) != RAW_PART &&
bounds_check_with_label(bp, vnd->sc_dk.dk_label,
vnd->sc_dk.dk_cpulabel, 1) == 0) {
+ s = splbio();
biodone(bp);
+ splx(s);
return;
}
@@ -493,7 +499,9 @@ vndstrategy(bp)
if (bp->b_error)
bp->b_flags |= B_ERROR;
bp->b_resid = auio.uio_resid;
+ s = splbio();
biodone(bp);
+ splx(s);
/* If nothing more is queued, we are done. */
if (!vnd->sc_tab.b_active)
@@ -581,7 +589,9 @@ vndstrategy(bp)
nbp->vb_buf.b_error = error;
nbp->vb_buf.b_flags |= B_ERROR;
bp->b_resid -= (resid - sz);
+ s = splbio();
biodone(&nbp->vb_buf);
+ splx(s);
return;
}
/*