summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2002-11-30 22:03:53 +0000
committeriedowse <iedowse@FreeBSD.org>2002-11-30 22:03:53 +0000
commit947ff5e0c7e877bcb6893dea15bd35000bf2d117 (patch)
treea6be107f84de8fdd7b8634a03db1325515de9dce /sys
parent001b8247ff73a95ecd5d14e04905b285eefb6396 (diff)
downloadFreeBSD-src-947ff5e0c7e877bcb6893dea15bd35000bf2d117.zip
FreeBSD-src-947ff5e0c7e877bcb6893dea15bd35000bf2d117.tar.gz
Move the check for the MD_SHUTDOWN flag to before the tsleep() call
in the per-device kthread. This ensures that synchronisation with mddestroy() succeeds even if the kthread was not waiting in tsleep() at the time of the wakeup(). Among other things, this fixes the problem of mdconfig getting stuck when an attempt is made to use a zero-length file as a vnode-type backing store. Approved by: re
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/md/md.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index e2922fc..acb09c0 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -577,12 +577,12 @@ md_kthread(void *arg)
bioq_remove(&sc->bio_queue, bp);
/* XXX: UNLOCK(unique unit numbers) */
if (!bp) {
- tsleep(sc, PRIBIO, "mdwait", 0);
if (sc->flags & MD_SHUTDOWN) {
sc->procp = NULL;
wakeup(&sc->procp);
kthread_exit(0);
}
+ tsleep(sc, PRIBIO, "mdwait", 0);
continue;
}
OpenPOWER on IntegriCloud