summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c
diff options
context:
space:
mode:
authormarco <marco@openbsd.org>2007-05-30 17:56:37 +0000
committermarco <marco@openbsd.org>2007-05-30 17:56:37 +0000
commit4eadffc15df88c353a3dc96995fe13cade5098d2 (patch)
treea36a5350d427bb7e1fa8ab3de0769dd95912f002 /sys/dev/softraid.c
parentMissed one minaddr initialization before invoking uvm_km_suballoc(). (diff)
downloadwireguard-openbsd-4eadffc15df88c353a3dc96995fe13cade5098d2.tar.xz
wireguard-openbsd-4eadffc15df88c353a3dc96995fe13cade5098d2.zip
Make sure that if there are staggered syncs that they complete successfully
before detaching the scsi bus. ok dlg
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r--sys/dev/softraid.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index 2f9033ea33d..06ae66287f2 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.60 2007/05/30 16:54:07 marco Exp $ */
+/* $OpenBSD: softraid.c,v 1.61 2007/05/30 17:56:37 marco Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
*
@@ -1340,6 +1340,12 @@ sr_shutdown_discipline(struct sr_discipline *sd)
DNPRINTF(SR_D_DIS, "%s: sr_shutdown_discipline %s\n",
DEVNAME(sc), sd->sd_vol.sv_meta.svm_devname);
+ /* make sure there isn't a sync pending and yield */
+ wakeup(sd);
+ while (tsleep(sr_shutdown_discipline, MAXPRI, "sr_down", 1 * hz) !=
+ EWOULDBLOCK)
+ ;
+
#ifndef SMALL_KERNEL
sr_delete_sensors(sd);
#endif /* SMALL_KERNEL */