summaryrefslogtreecommitdiffstats
path: root/sys/dev/vnd.c
diff options
context:
space:
mode:
authorpedro <pedro@openbsd.org>2006-03-04 22:53:32 +0000
committerpedro <pedro@openbsd.org>2006-03-04 22:53:32 +0000
commit00752442b44e2fc4809b3f7ea5a0db9c44da67e5 (patch)
tree70750db9e4380641f3ee73b12b37639a18d8eb4c /sys/dev/vnd.c
parentWith the exception of two other small uncommited diffs this moves (diff)
downloadwireguard-openbsd-00752442b44e2fc4809b3f7ea5a0db9c44da67e5.tar.xz
wireguard-openbsd-00752442b44e2fc4809b3f7ea5a0db9c44da67e5.zip
Disk interrupts can cause buffers to be returned to the vnd pool, so
splbio() is required when allocating. Fixes PR kern/5041, okay tedu@.
Diffstat (limited to 'sys/dev/vnd.c')
-rw-r--r--sys/dev/vnd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index ec6e527ac63..8ee2531b1d9 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnd.c,v 1.58 2006/01/22 00:40:02 miod Exp $ */
+/* $OpenBSD: vnd.c,v 1.59 2006/03/04 22:53:32 pedro Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
@@ -568,7 +568,9 @@ vndstrategy(bp)
vnd->sc_vp, vp, bn, nbn, sz);
#endif
+ s = splbio();
nbp = getvndbuf();
+ splx(s);
nbp->vb_buf.b_flags = flags;
nbp->vb_buf.b_bcount = sz;
nbp->vb_buf.b_bufsize = bp->b_bufsize;