From 4eadffc15df88c353a3dc96995fe13cade5098d2 Mon Sep 17 00:00:00 2001 From: marco Date: Wed, 30 May 2007 17:56:37 +0000 Subject: Make sure that if there are staggered syncs that they complete successfully before detaching the scsi bus. ok dlg --- sys/dev/softraid.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sys/dev/softraid.c') 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 * @@ -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 */ -- cgit v1.2.3-59-g8ed1b