]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
When using the force option to shut down a memory-disk device,
authormckusick <mckusick@FreeBSD.org>
Sun, 31 Mar 2019 21:34:58 +0000 (21:34 +0000)
committermckusick <mckusick@FreeBSD.org>
Sun, 31 Mar 2019 21:34:58 +0000 (21:34 +0000)
commit06b019117682c0d91074b4368e37acdd48f026f4
treeff60f0cc04a4997d47c235364398b6ee1ae41ada
parenta12312b811a64550b23e3bcee7727bbfec70246a
When using the force option to shut down a memory-disk device,
I/O operations already in its queue were not being properly drained.
The GEOM framework does the queue draining, but the device driver
needs to wait for the draining to happen. The waiting is done by
adding a g_md_providergone() function to wait for the I/O operations
to finish up.

It is likely that every GEOM provider that implements orphaning
attached GEOM consumers needs to use the "providergone" mechanism
for this same reason, but some of them do not do so. Apparently
Kenneth Merry (ken@) added the drain for just such races, but he
missed adding it to some of the device drivers that needed it.

Submitted by: Chuck Silvers
Reviewed by:  imp
Tested by:    Chuck Silvers
MFC after:    1 week
Sponsored by: Netflix
sys/dev/md/md.c