The GEOM KPI in stable/10 requires Giant to be unacquired (a requirement

dropped in r300287). So wrap calling into GEOM in {DROP,PICKUP}_GIANT(),
similar to what as been done prio to r300288. This fixes a "Giant owned"
panic with r318159 in place and INVARIANTS enabled.
Reported by: Oliver Pinter
This commit is contained in:
Marius Strobl 2017-06-20 19:59:57 +00:00
parent f16ea26c4a
commit 70fe26738a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/10/; revision=320168

View File

@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/slicer.h>
#include <geom/geom.h>
@ -230,10 +231,12 @@ g_flashmap_load(device_t dev, struct g_provider *pp, flash_slicer_t slicer,
void flash_register_slicer(flash_slicer_t slicer, u_int type, bool force)
{
DROP_GIANT();
g_topology_lock();
if (g_flashmap_slicers[type].slicer == NULL || force == TRUE)
g_flashmap_slicers[type].slicer = slicer;
g_topology_unlock();
PICKUP_GIANT();
}
static struct g_class g_flashmap_class = {