Avoid sleeping when the mirror I/O queue is non-empty.

A request may be queued while the queue lock is dropped when the mirror is
being destroyed. The corresponding wakeup would be lost, possibly resulting
in an apparent hang of the mirror worker thread.

Tested by:	pho (part of a larger patch)
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
This commit is contained in:
markj 2017-03-29 19:39:07 +00:00
parent f1678a8682
commit 15ebdcc4bf

View File

@ -1917,6 +1917,10 @@ g_mirror_worker(void *arg)
kproc_exit(0);
}
mtx_lock(&sc->sc_queue_mtx);
if (bioq_first(&sc->sc_queue) != NULL) {
mtx_unlock(&sc->sc_queue_mtx);
continue;
}
}
sx_xunlock(&sc->sc_lock);
/*