]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
Creation of reserved SP moves EP state to DAT_EP_STATE_RESERVED even in failure cases...
authorArlin Davis <arlin.r.davis@intel.com>
Tue, 15 Apr 2014 20:44:16 +0000 (13:44 -0700)
committerArlin Davis <arlin.r.davis@intel.com>
Thu, 22 May 2014 21:57:45 +0000 (14:57 -0700)
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
dapl/common/dapl_rsp_create.c

index 13fe09bccd39a1f6242db01e074bde9bba2d79a8..52afcdef8fe035132c51b6edd312d2db39a7e5a8 100644 (file)
@@ -154,11 +154,6 @@ dapl_rsp_create(IN DAT_IA_HANDLE ia_handle,
         */
        dapl_os_atomic_inc(&((DAPL_EVD *) evd_handle)->evd_ref_count);
 
-       /*
-        * Update the EP state indicating the provider now owns it
-        */
-       ep_ptr->param.ep_state = DAT_EP_STATE_RESERVED;
-
        /* 
         * Set up a listener for a connection. Connections can arrive
         * even before this call returns!
@@ -179,8 +174,7 @@ dapl_rsp_create(IN DAT_IA_HANDLE ia_handle,
                         * wrong!  Decrements the EVD refcount & release it. Set 
                         * the state to FREE, so we know the call failed.
                         */
-                       dapl_os_atomic_dec(&((DAPL_EVD *) evd_handle)->
-                                          evd_ref_count);
+                       dapl_os_atomic_dec(&((DAPL_EVD *) evd_handle)->evd_ref_count);
                        sp_ptr->evd_handle = NULL;
                        sp_ptr->state = DAPL_SP_STATE_FREE;
                        dapls_ia_unlink_sp(ia_ptr, sp_ptr);
@@ -199,6 +193,11 @@ dapl_rsp_create(IN DAT_IA_HANDLE ia_handle,
         */
        *rsp_handle = (DAT_RSP_HANDLE) sp_ptr;
 
+       /*
+        * Update the EP state indicating the provider now owns it
+        */
+       ep_ptr->param.ep_state = DAT_EP_STATE_RESERVED;
+
       bail:
        return dat_status;
 }