Ryan,
this patch breaks SAF Test SaLckLockGrantCallbackT/10.c, and there is
no close before unlock. I made a patch, but I'm really not sure about
correctness.

Regards,
  Honza

Ryan O'Hara wrote:
> When unlocking a pending lock request, we must send a response (or
> callback) to the library indicating an error occured. This patch
> simply adds a check that the lock is pending before we send the
> response.
> 
> Without this fix, callbacks are sent when they are not needed. For
> example, if we close a resource while holding locks we will hit this
> code (in lck_unlock) that will incorrectly send callbacks to the
> library.
> 
> Ryan
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Openais mailing list
> [email protected]
> https://lists.linux-foundation.org/mailman/listinfo/openais

diff --git a/trunk/services/lck.c b/trunk/services/lck.c
index 0e65ba1..6f85111 100644
--- a/trunk/services/lck.c
+++ b/trunk/services/lck.c
@@ -1819,9 +1819,8 @@ static void lck_unlock (
 				api->timer_delete (resource_lock->timer_handle);
 				lck_resourcelock_response_send (resource_lock, SA_AIS_ERR_TIMEOUT);
 			}
-			else {
-				lck_lockgrant_callback_send (resource_lock, SA_AIS_ERR_NOT_EXIST);
-			}
+		} else {
+			lck_lockgrant_callback_send (resource_lock, SA_AIS_ERR_NOT_EXIST);
 		}
 	}
 
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to