summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-01-19 22:21:39 +0000
committerjsing <jsing@openbsd.org>2014-01-19 22:21:39 +0000
commit8ec36570d0802e84562574852ad52fa047df380e (patch)
treeea75eafe1f912b9beada1c828393d94a021160ad /sys/dev/softraid.c
parentRemove bogus .Tn; found with mandocdb(8). (diff)
downloadwireguard-openbsd-8ec36570d0802e84562574852ad52fa047df380e.tar.xz
wireguard-openbsd-8ec36570d0802e84562574852ad52fa047df380e.zip
Assert that a workunit has ccbs if it is being scheduled. Otherwise we
deadlock since nothing will ever come back to tell us that the workunit is completed. ok krw@
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r--sys/dev/softraid.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index a853d43f72b..13c78276c4e 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.318 2014/01/18 09:33:53 jsing Exp $ */
+/* $OpenBSD: softraid.c,v 1.319 2014/01/19 22:21:39 jsing Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -4160,6 +4160,8 @@ sr_schedule_wu(struct sr_workunit *wu)
DNPRINTF(SR_D_WU, "sr_schedule_wu: schedule wu %p state %i "
"flags 0x%x\n", wu, wu->swu_state, wu->swu_flags);
+ KASSERT(wu->swu_io_count > 0);
+
s = splbio();
/* Construct the work unit, do not schedule it. */