[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-3339-g0e30f6d

Jeremy Allison jra at samba.org
Thu Jan 8 18:40:24 GMT 2009


The branch, v3-2-test has been updated
       via  0e30f6d835016a73e89e3159d827a2703058d34b (commit)
      from  097e9d64ade609da9f920156c98b466dc6c42dab (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 0e30f6d835016a73e89e3159d827a2703058d34b
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Jan 8 10:38:44 2009 -0800

    Fix race condition in alarm lock processing noticed by Richard Sharpe <realrichardsharpe at gmail.com>.
    "It seems to me that if the lock is already held by another process when we
    enter this code, there is a race between the timeout and the granting. If
    the lock is subsequently granted, the process releasing the lock will signal
    the wait variable (or whatever) and our process will be scheduled. However,
    if the timeout occurs before we are scheduled, the timeout will be delivered
    first.
    
    We will have the lock but will forget we have the lock, and never release
    it."
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source/lib/util_tdb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/util_tdb.c b/source/lib/util_tdb.c
index 8257232..6d61fd9 100644
--- a/source/lib/util_tdb.c
+++ b/source/lib/util_tdb.c
@@ -86,7 +86,7 @@ static int tdb_chainlock_with_timeout_internal( TDB_CONTEXT *tdb, TDB_DATA key,
 		alarm(0);
 		tdb_setalarm_sigptr(tdb, NULL);
 		CatchSignal(SIGALRM, SIGNAL_CAST SIG_IGN);
-		if (gotalarm) {
+		if (gotalarm && (ret == -1)) {
 			DEBUG(0,("tdb_chainlock_with_timeout_internal: alarm (%u) timed out for key %s in tdb %s\n",
 				timeout, key.dptr, tdb_name(tdb)));
 			/* TODO: If we time out waiting for a lock, it might


-- 
Samba Shared Repository


More information about the samba-cvs mailing list