Today when I am testing it works with this patch.

I can not reproduce the problem I had yesterday.
So it seems I had made some error.
Possibly not stopped all uml-linux instances successfully, before restarting 
the next uml session.
Verry strange.

Ack on this patch then.

/AndersBj


-----Original Message-----
From: Anders Björnerstedt 
Sent: den 11 september 2014 16:58
To: Hans Feldt
Cc: [email protected]
Subject: RE: [PATCH 1 of 1] imma: fix potential race with is_immnd_up [#1050]

I have to NACK this patch.

Cluster does not even come up with it.

Not sure why.

/AndersBj

-----Original Message-----
From: Hans Feldt
Sent: den 11 september 2014 15:43
To: Anders Björnerstedt
Cc: [email protected]
Subject: [PATCH 1 of 1] imma: fix potential race with is_immnd_up [#1050]

 osaf/libs/agents/saf/imma/imma_mds.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)


The variable is_immnd_up is read in API calls without holding a lock. In the 
MDS IMMND UP callback it was set to true _before_ registration with the "auth  
server". This could allow clients sitting in a TRYAGAIN loop to proceed before 
auth server registration has finished.

Auth server registration is now done before setting is_immnd_up to true.

diff --git a/osaf/libs/agents/saf/imma/imma_mds.c 
b/osaf/libs/agents/saf/imma/imma_mds.c
--- a/osaf/libs/agents/saf/imma/imma_mds.c
+++ b/osaf/libs/agents/saf/imma/imma_mds.c
@@ -419,9 +419,6 @@ static uint32_t imma_mds_svc_evt(IMMA_CB
 
                case NCSMDS_UP:
                        TRACE_3("IMMND UP");
-                       
m_NCS_LOCK(&cb->immnd_sync_lock,NCS_LOCK_WRITE);/*special sync lock*/
-                       cb->is_immnd_up = true;
-                       cb->immnd_mds_dest = svc_evt->i_dest;
 
                        /* (Re-)connect and register our MDS dest with auth 
server in immnd */
                        if (mds_auth_server_connect(sockname,
@@ -430,6 +427,10 @@ static uint32_t imma_mds_svc_evt(IMMA_CB
                                LOG_WA("%s: mds_auth_server_connect failed", 
__FUNCTION__);
                        }
 
+                       
m_NCS_LOCK(&cb->immnd_sync_lock,NCS_LOCK_WRITE);/*special sync lock*/
+                       cb->immnd_mds_dest = svc_evt->i_dest;
+                       cb->is_immnd_up = true;
+
                        if (cb->immnd_sync_awaited == true)
                                m_NCS_SEL_OBJ_IND(&cb->immnd_sync_sel);
                        
m_NCS_UNLOCK(&cb->immnd_sync_lock,NCS_LOCK_WRITE);/*special sync lock*/

------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to