Created attachment 157577 [details]
disk_gone() can happen at any time due to hardware failures, and start withering GEOM devices. If something closes a device at about the same time, g_access() can queue an event that will call g_new_provider_event(), and the provider may have G_PF_WITHER set by the time g_new_provider_event() gets called, which panics a debug kernel.
The attached patch replaces the KASSERT with a check of G_PF_WITHER, and just returns if it's set, since it doesn't make sense to taste a device that's going away.
I once wrote the following patch:
but never committed it.
I wonder if the patch would help here as well.
Could you please test?
P.S. If you have any problem adapting the patch to the current code please let me know and I will do it.