aboutsummaryrefslogtreecommitdiff
path: root/sys/geom
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2016-10-20 23:02:30 +0000
committerMark Johnston <markj@FreeBSD.org>2016-10-20 23:02:30 +0000
commitb450976dc22455c75e0a2ecd9ba665c725bf59c8 (patch)
tree2ee0c5bd0056a2d675f44b0da66a48b66daa10b6 /sys/geom
parentc615275cccc56514f2eaf42112f9e604507c0feb (diff)
downloadsrc-b450976dc22455c75e0a2ecd9ba665c725bf59c8.tar.gz
src-b450976dc22455c75e0a2ecd9ba665c725bf59c8.zip
gmirror: Release pending regular requests when synchronization stops.
Normally gmirror allows colliding requests to proceed whenever a synchronization request completes and advances to the next offset. However if an I/O request collides with one of the final g_mirror_syncreqs, nothing releases it once synchronization completes, resulting in an apparent I/O hang. The same problem can occur if synchronization is aborted by an I/O error. Therefore, be sure to requeue pending requests when mirror synchronization is stopped for any reason. While here, remove some dead code from g_mirror_regular_release(). MFC after: 2 weeks Sponsored by: Dell EMC Isilon
Notes
Notes: svn path=/head/; revision=307691
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/mirror/g_mirror.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c
index 308e711fcc1d..4018f8d6d172 100644
--- a/sys/geom/mirror/g_mirror.c
+++ b/sys/geom/mirror/g_mirror.c
@@ -1252,13 +1252,6 @@ g_mirror_regular_release(struct g_mirror_softc *sc)
G_MIRROR_LOGREQ(2, bp, "Releasing delayed request (%p).", bp);
mtx_lock(&sc->sc_queue_mtx);
bioq_insert_head(&sc->sc_queue, bp);
-#if 0
- /*
- * wakeup() is not needed, because this function is called from
- * the worker thread.
- */
- wakeup(&sc->sc_queue);
-#endif
mtx_unlock(&sc->sc_queue_mtx);
}
}
@@ -2065,6 +2058,7 @@ g_mirror_sync_stop(struct g_mirror_disk *disk, int type)
G_MIRROR_DEBUG(0, "Device %s: rebuilding provider %s stopped.",
sc->sc_name, g_mirror_get_diskname(disk));
}
+ g_mirror_regular_release(sc);
free(disk->d_sync.ds_bios, M_MIRROR);
disk->d_sync.ds_bios = NULL;
cp = disk->d_sync.ds_consumer;