summaryrefslogtreecommitdiff
path: root/usr/src/cmd/fm
diff options
context:
space:
mode:
authorHyon Kim <Hyon.Kim@Sun.COM>2010-07-28 23:06:01 -0700
committerHyon Kim <Hyon.Kim@Sun.COM>2010-07-28 23:06:01 -0700
commitd10eddf70e75478ac778e9b04d3d711fe8c3273b (patch)
tree04705762518c852e3b0867a24729ff50c4b6aa0f /usr/src/cmd/fm
parentdae53167bb7a482c2233133cf1d8a0f9893b364a (diff)
downloadillumos-gate-d10eddf70e75478ac778e9b04d3d711fe8c3273b.tar.gz
6953050 fmd dumped multiple cores at topo_hdl_root.
Diffstat (limited to 'usr/src/cmd/fm')
-rw-r--r--usr/src/cmd/fm/fmd/common/fmd_module.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/usr/src/cmd/fm/fmd/common/fmd_module.c b/usr/src/cmd/fm/fmd/common/fmd_module.c
index 8d99794125..ea38135c64 100644
--- a/usr/src/cmd/fm/fmd/common/fmd_module.c
+++ b/usr/src/cmd/fm/fmd/common/fmd_module.c
@@ -526,6 +526,7 @@ fmd_module_dispatch(fmd_module_t *mp, fmd_event_t *e)
fmd_event_impl_t *ep = (fmd_event_impl_t *)e;
fmd_hdl_t *hdl = (fmd_hdl_t *)mp;
fmd_modtimer_t *t;
+ fmd_topo_t *old_topo;
volatile int err;
/*
@@ -575,9 +576,22 @@ fmd_module_dispatch(fmd_module_t *mp, fmd_event_t *e)
fmd_case_publish(ep->ev_data, FMD_CASE_CURRENT);
break;
case FMD_EVT_TOPO:
- fmd_topo_rele(mp->mod_topo_current);
+ /*
+ * Save the pointer to the old topology and update
+ * the pointer with the updated topology.
+ * With this approach, other threads that reference the
+ * topology either
+ * - finishes with old topology since
+ * it is released after updating
+ * mod_topo_current.
+ * - or is blocked while mod_topo_current is updated.
+ */
+ old_topo = mp->mod_topo_current;
+ fmd_module_lock(mp);
mp->mod_topo_current = (fmd_topo_t *)ep->ev_data;
fmd_topo_addref(mp->mod_topo_current);
+ fmd_module_unlock(mp);
+ fmd_topo_rele(old_topo);
ops->fmdo_topo(hdl, mp->mod_topo_current->ft_hdl);
break;
}