From: Alex Netes <[email protected]> Callback execution should be under read lock as it accesses global data.
Signed-off-by: Alex Netes <[email protected]> Signed-off-by: Hal Rosenstock <[email protected]> --- opensm/osm_trap_rcv.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/opensm/osm_trap_rcv.c b/opensm/osm_trap_rcv.c index 4e59a17..6a7936d 100644 --- a/opensm/osm_trap_rcv.c +++ b/opensm/osm_trap_rcv.c @@ -115,6 +115,8 @@ static uint64_t aging_tracker_callback(IN uint64_t key, IN uint32_t num_regs, lid = (ib_net16_t) ((key & 0x0000FFFF00000000ULL) >> 32); port_num = (uint8_t) ((key & 0x00FF000000000000ULL) >> 48); + CL_PLOCK_ACQUIRE(sm->p_lock); + p_physp = get_physp_by_lid_and_num(sm, lid, port_num); if (!p_physp) { OSM_LOG(sm->p_log, OSM_LOG_VERBOSE, @@ -140,5 +142,6 @@ static uint64_t aging_tracker_callback(IN uint64_t key, IN uint32_t num_regs, } + CL_PLOCK_RELEASE(sm->p_lock); OSM_LOG_EXIT(sm->p_log); /* We want to remove the event from the tracker - so -- 1.7.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
