Date: Mon, 26 Apr 2010 16:20:19 +0000 (UTC) From: Jaakko Heinonen <jh@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r207226 - stable/8/sys/geom Message-ID: <201004261620.o3QGKJAp034826@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <ddb/ddb.h> #endif +#ifdef KDB +#include <sys/kdb.h> +#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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004261620.o3QGKJAp034826>