[Openais] [PATCH]: openais/trunk: Send LockGrantCallback whenever status != 0

Ryan O'Hara rohara at redhat.com
Thu Jun 4 10:57:23 PDT 2009


In the case where we request a lock with saLckResourceLockAsync and
the request is not granted (eg. status is SA_LCK_LOCK_NOT_QUEUED or
SA_LCK_LOCK_ORPHANED) we should send a callback. The existing code
only sends a LockGrantCallback when the lock is actually granted,
which is wrong.

Honzaf, this should fix the problem we discussed earlier today on
IRC. The saftest code was blocked on the select() because I never sent
a callback when the request was made with SA_LCK_LOCK_NO_QUEUE and
could not be granted.

Ryan

-------------- next part --------------
Index: services/lck.c
===================================================================
--- services/lck.c	(revision 1938)
+++ services/lck.c	(working copy)
@@ -2443,7 +2443,8 @@
 			&res_lib_lck_resourcelockasync,
 			sizeof (struct res_lib_lck_resourcelockasync));
 
-		if ((lock != NULL) && (lock->lock_status == SA_LCK_LOCK_GRANTED)) {
+		/* if ((lock != NULL) && (lock->lock_status == SA_LCK_LOCK_GRANTED)) { */
+		if ((lock != NULL) && (lock->lock_status != 0)) {
 			lck_lockgrant_callback_send (lock, error);
 		}
 	}


More information about the Openais mailing list