Date: Tue, 20 Jun 2017 19:59:57 +0000 (UTC) From: Marius Strobl <marius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320168 - stable/10/sys/geom Message-ID: <201706201959.v5KJxvtI008283@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marius Date: Tue Jun 20 19:59:57 2017 New Revision: 320168 URL: https://svnweb.freebsd.org/changeset/base/320168 Log: 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 Modified: stable/10/sys/geom/geom_flashmap.c Modified: stable/10/sys/geom/geom_flashmap.c ============================================================================== --- stable/10/sys/geom/geom_flashmap.c Tue Jun 20 19:45:02 2017 (r320167) +++ stable/10/sys/geom/geom_flashmap.c Tue Jun 20 19:59:57 2017 (r320168) @@ -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, f 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 = {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706201959.v5KJxvtI008283>