From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 26 16:20:19 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A60B6106564A; Mon, 26 Apr 2010 16:20:19 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B9AF8FC0A; Mon, 26 Apr 2010 16:20:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3QGKJEG034827; Mon, 26 Apr 2010 16:20:19 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QGKJAp034826; Mon, 26 Apr 2010 16:20:19 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201004261620.o3QGKJAp034826@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 26 Apr 2010 16:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207226 - stable/8/sys/geom X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 16:20:19 -0000 Author: jh Date: Mon Apr 26 16:20:18 2010 New Revision: 207226 URL: http://svn.freebsd.org/changeset/base/207226 Log: MFC r206859: Fix ddb(4) "show geom addr" command when INVARIANTS is enabled. Don't assert that the topology lock is held when g_valid_obj() is called from debugger. Modified: stable/8/sys/geom/geom_subr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/geom/geom_subr.c ============================================================================== --- stable/8/sys/geom/geom_subr.c Mon Apr 26 15:31:58 2010 (r207225) +++ stable/8/sys/geom/geom_subr.c Mon Apr 26 16:20:18 2010 (r207226) @@ -59,6 +59,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef KDB +#include +#endif + struct class_list_head g_classes = LIST_HEAD_INITIALIZER(g_classes); static struct g_tailq_head geoms = TAILQ_HEAD_INITIALIZER(geoms); char *g_wait_event, *g_wait_up, *g_wait_down, *g_wait_sim; @@ -1010,12 +1014,11 @@ g_getattr__(const char *attr, struct g_c #if defined(DIAGNOSTIC) || defined(DDB) /* - * This function walks (topologically unsafely) the mesh and return a - * non-zero integer if it finds the argument pointer is an object. - * The return value indicates which type of object it is belived to be. - * If topology is not locked, this function is potentially dangerous, - * but since it is for debugging purposes and can be useful for instance - * from DDB, we do not assert topology lock is held. + * This function walks the mesh and returns a non-zero integer if it + * finds the argument pointer is an object. The return value indicates + * which type of object it is believed to be. If topology is not locked, + * this function is potentially dangerous, but we don't assert that the + * topology lock is held when called from debugger. */ int g_valid_obj(void const *ptr) @@ -1025,7 +1028,10 @@ g_valid_obj(void const *ptr) struct g_consumer *cp; struct g_provider *pp; - g_topology_assert(); +#ifdef KDB + if (kdb_active == 0) +#endif + g_topology_assert(); LIST_FOREACH(mp, &g_classes, class) { if (ptr == mp)