summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-09-19 06:46:35 +0000
committerAndrew Tridgell <tridge@samba.org>2001-09-19 06:46:35 +0000
commit01bb01b3ca0be89dacb73b5f7add2bb682735b5a (patch)
treefcd952d737d12fa6a3d80be1e5353bfc2886c461 /source3
parent6a7e334ea38221b625fdb534b1e138c68933da25 (diff)
downloadsamba-01bb01b3ca0be89dacb73b5f7add2bb682735b5a.tar.gz
samba-01bb01b3ca0be89dacb73b5f7add2bb682735b5a.tar.bz2
samba-01bb01b3ca0be89dacb73b5f7add2bb682735b5a.zip
removed anti-race code that could cause a classic ABBA deadlock
I'd rather get the connection count wrong with a small probability than deadlock (This used to be commit d4e4e81328a63d6e3396306d5dae6cc45ddd35d7)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/connection.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c
index 399851302c..0f0697b1c7 100644
--- a/source3/smbd/connection.c
+++ b/source3/smbd/connection.c
@@ -114,8 +114,7 @@ BOOL claim_connection(connection_struct *conn,char *name,int max_connections,BOO
{
struct connections_key key;
struct connections_data crec;
- TDB_DATA kbuf, dbuf, lockkey;
- BOOL rec_locked = False;
+ TDB_DATA kbuf, dbuf;
BOOL ret = True;
if (!tdb) {
@@ -137,22 +136,6 @@ BOOL claim_connection(connection_struct *conn,char *name,int max_connections,BOO
cs.name = lp_servicename(SNUM(conn));
cs.Clear = Clear;
- lockkey.dptr = cs.name;
- lockkey.dsize = strlen(cs.name)+1;
-
- /*
- * Go through and count the connections with hash chain representing the service name
- * locked. This is slow but removes race conditions. JRA.
- */
-
- if (tdb_chainlock(tdb, lockkey)) {
- DEBUG(0,("claim_connection: tdb_chainlock failed %s\n",
- tdb_errorstr(tdb) ));
- return False;
- }
-
- rec_locked = True;
-
if (tdb_traverse(tdb, count_fn, &cs) == -1) {
DEBUG(0,("claim_connection: traverse of connections.tdb failed with error %s.\n",
tdb_errorstr(tdb) ));
@@ -205,8 +188,5 @@ BOOL claim_connection(connection_struct *conn,char *name,int max_connections,BOO
out:
- if (rec_locked)
- tdb_chainunlock(tdb, lockkey);
-
return ret;
}