From owner-svn-src-stable-10@freebsd.org Tue Jun 20 19:59:58 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD627DA0F45; Tue, 20 Jun 2017 19:59:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A800D714C9; Tue, 20 Jun 2017 19:59:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5KJxvPs008284; Tue, 20 Jun 2017 19:59:57 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5KJxvtI008283; Tue, 20 Jun 2017 19:59:57 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201706201959.v5KJxvtI008283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 20 Jun 2017 19:59:57 +0000 (UTC) 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 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jun 2017 19:59:59 -0000 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 #include #include +#include #include #include @@ -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 = {