osm_trap_rcv.c: Fix locking in aging callback
PATCH 1/1 osm_trap_rcv.c: Fix locking in aging callback
From: Alex Netes <alexne-VPRAkNaXOzVWk0Htik3J/[email protected]>
Callback execution should be under read lock as it accesses global data.
--- opensm/osm_trap_rcv.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
opensm/osm_trap_rcv.c +3 -0
@@ -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
Signature · 6 lines
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