diff options
author | Mark Johnston <markj@FreeBSD.org> | 2017-03-29 19:39:07 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2017-03-29 19:39:07 +0000 |
commit | 0d75d0dfbc44356426127ed42874eb61edc413b9 (patch) | |
tree | bc69f2a5942b2864494321a182cda00ea2b2db0f /sys/geom | |
parent | c1ab409cba45d8e79ca9d94c8f65c113d548a1df (diff) | |
download | src-0d75d0dfbc44356426127ed42874eb61edc413b9.tar.gz src-0d75d0dfbc44356426127ed42874eb61edc413b9.zip |
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
Notes
Notes:
svn path=/head/; revision=316175
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/mirror/g_mirror.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index 621b334c48fa..704810823ff1 100644 --- a/sys/geom/mirror/g_mirror.c +++ b/sys/geom/mirror/g_mirror.c @@ -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); /* |