[openib-general] [PATCH] opensm: sa mcmember_rec leave locking

Sasha Khapyorsky sashak at voltaire.com
Sun Dec 17 04:52:30 PST 2006


Hold locked multicast group leave request (MCMember Record) processing.
This prevents kind of race with multicast group join request where
those requests can be reordered during processing.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 osm/opensm/osm_sa_mcmember_record.c |    2 +-
 osm/opensm/osm_sm.c                 |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/osm/opensm/osm_sa_mcmember_record.c b/osm/opensm/osm_sa_mcmember_record.c
index 3fec8b9..382dcff 100644
--- a/osm/opensm/osm_sa_mcmember_record.c
+++ b/osm/opensm/osm_sa_mcmember_record.c
@@ -1471,7 +1471,7 @@ __osm_mcmr_rcv_leave_mgrp(
         mcmember_rec.scope_state = p_mcm_port->scope_state;
 
         /* OK we can leave */
-        CL_PLOCK_RELEASE( p_rcv->p_lock );
+	/* note: osm_sm_mcgrp_leave() will release p_rcv->p_lock */
 
         status = osm_sm_mcgrp_leave(p_rcv->p_sm, mlid, portguid);
         if(status != IB_SUCCESS)
diff --git a/osm/opensm/osm_sm.c b/osm/opensm/osm_sm.c
index 70c3584..71fd847 100644
--- a/osm/opensm/osm_sm.c
+++ b/osm/opensm/osm_sm.c
@@ -776,7 +776,8 @@ osm_sm_mcgrp_leave(
    /*
     * Acquire the port object for the port leaving this group.
     */
-   CL_PLOCK_EXCL_ACQUIRE( p_sm->p_lock );
+   /* note: p_sm->p_lock is locked by caller, but will be released later
+      this function */
    p_port = ( osm_port_t * ) cl_qmap_get( &p_sm->p_subn->port_guid_tbl,
                                           port_guid );
    if( p_port ==
-- 
1.4.4.1.gbfd3





More information about the general mailing list