[SCM] CTDB repository - branch 1.2.40 updated - ctdb-1.2.55-2-g0e99ca1

2012-12-21 Thread Amitay Isaacs
The branch, 1.2.40 has been updated
   via  0e99ca1cdf28a7043554afb78bd439f727ab4f95 (commit)
   via  e80b2c15bf8c8fb5c3793acfebbe09d3cdd617b7 (commit)
  from  8b2d84482bacd3b31db013496ce82c2e7b730e86 (commit)

http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=1.2.40


- Log -
commit 0e99ca1cdf28a7043554afb78bd439f727ab4f95
Author: Amitay Isaacs ami...@gmail.com
Date:   Wed Dec 5 11:38:42 2012 +1100

scripts: Add helper script to log locking information using /proc/locks

This finds any processes locking tdb databases used by CTDB and logs
stack trace for each process.

Signed-off-by: Amitay Isaacs ami...@gmail.com

commit e80b2c15bf8c8fb5c3793acfebbe09d3cdd617b7
Author: Amitay Isaacs ami...@gmail.com
Date:   Wed Dec 5 11:37:26 2012 +1100

daemon: Run an external script if freeze locks were not obtained during 
recovery

If the freeze child is already created in ctdb_start_freeze(), then it 
indicates
that the child process has not yet obtained the locks.  This may be because
another process has locked the databases and has not yet released the locks.

In this case, invoke a helper script defined by environmental variable
CTDB_DEBUG_LOCKS, to log information about locks.

Signed-off-by: Amitay Isaacs ami...@gmail.com

---

Summary of changes:
 Makefile.in|1 +
 config/debug_locks.sh  |   38 ++
 packaging/RPM/ctdb.spec.in |1 +
 server/ctdb_freeze.c   |   24 
 4 files changed, 64 insertions(+), 0 deletions(-)
 create mode 100755 config/debug_locks.sh


Changeset truncated at 500 lines:

diff --git a/Makefile.in b/Makefile.in
index e3d6d5b..136ae30 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -264,6 +264,7 @@ install: all
${INSTALLCMD} -m 644 config/functions $(DESTDIR)$(etcdir)/ctdb
${INSTALLCMD} -m 755 config/statd-callout $(DESTDIR)$(etcdir)/ctdb
${INSTALLCMD} -m 755 config/interface_modify.sh $(DESTDIR)$(etcdir)/ctdb
+   ${INSTALLCMD} -m 755 config/debug_locks.sh $(DESTDIR)$(etcdir)/ctdb
${INSTALLCMD} -m 644 config/events.d/README 
$(DESTDIR)$(docdir)/ctdb/README.eventscripts
${INSTALLCMD} -m 644 doc/recovery-process.txt 
$(DESTDIR)$(docdir)/ctdb/recovery-process.txt
${INSTALLCMD} -m 755 config/events.d/00.ctdb 
$(DESTDIR)$(etcdir)/ctdb/events.d
diff --git a/config/debug_locks.sh b/config/debug_locks.sh
new file mode 100755
index 000..5b9efed
--- /dev/null
+++ b/config/debug_locks.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# Create sed expression to convert inodes to names
+sed_cmd=$( ls -li /var/ctdb/*.tdb.* /var/ctdb/persistent/*.tdb.* |
+  sed -e s#/var/ctdb[/persistent]*/\(.*\)#\1# |
+  awk '{printf s#[0-9]*:[0-9]*:%s #%s #\n, $1, $10}' )
+
+# Parse /proc/locks and extract following information
+#pid process_name tdb_name offsets [W]
+out=$( cat /proc/locks |
+grep -F POSIX  ADVISORY  WRITE |
+awk '{ if($2 == -) { print $6, $7, $8, $9, W } else { print $5, $6, 
$7, $8 } }' |
+while read pid rest ; do
+   pname=$(readlink /proc/$pid/exe)
+   echo $pid $pname $rest
+done | sed -e $sed_fu | grep \.tdb )
+
+if [ -n $out ]; then
+# Log information about locks
+echo $out | logger -t debug-lock
+
+# Find processes that are waiting for locks
+dbs=$(echo $out | grep W$ | awk '{print $3}')
+all_pids=
+for db in $dbs ; do
+   pids=$(echo $out | grep -v W$ | grep $db | grep -v ctdbd | awk 
'{print $1}')
+   all_pids=$all_pids $pids
+done
+pids=$(echo $all_pids | sort -u)
+
+# For each process waiting, log stack trace
+for pid in $pids ; do
+   gstack $pid | logger -t debug-lock $pid
+#  gcore -o /var/log/core-deadlock-ctdb $pid
+done
+fi
+
+exit 0
diff --git a/packaging/RPM/ctdb.spec.in b/packaging/RPM/ctdb.spec.in
index de8193d..39a5df9 100644
--- a/packaging/RPM/ctdb.spec.in
+++ b/packaging/RPM/ctdb.spec.in
@@ -113,6 +113,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_sysconfdir}/ctdb/events.d/91.lvs
 %{_sysconfdir}/ctdb/statd-callout
 %{_sysconfdir}/ctdb/interface_modify.sh
+%{_sysconfdir}/ctdb/debug_locks.sh
 %{_sbindir}/ctdbd
 %{_bindir}/ctdb
 %{_bindir}/smnotify
diff --git a/server/ctdb_freeze.c b/server/ctdb_freeze.c
index 0f70fd3..f422e6d 100644
--- a/server/ctdb_freeze.c
+++ b/server/ctdb_freeze.c
@@ -256,6 +256,26 @@ static int ctdb_freeze_waiter_destructor(struct 
ctdb_freeze_waiter *w)
 }
 
 /*
+ * Run an external script to check if there is a deadlock situation
+ */
+static void ctdb_debug_locks(void)
+{
+   const char *cmd = getenv(CTDB_DEBUG_LOCKS);
+   int pid;
+
+   if (cmd == NULL) {
+   return;
+   }
+
+   pid = fork();
+
+   /* Execute only in child process */
+   if (pid == 0) {
+   execl(cmd, cmd, NULL);
+   

[SCM] Samba Shared Repository - branch master updated

2012-12-21 Thread Stefan Metzmacher
The branch, master has been updated
   via  a444bb9 tdb: Add a comment explaining the check
   via  3109b54 tdb: Make tdb_new_database() follow a more conventional 
style
   via  d972e6f tdb: Fix a typo
   via  c04de8f tdb: Fix a typo
   via  24755d7 tdb: Use tdb_lock_covered_by_allrecord_lock in tdb_unlock
   via  f8dafe5 tdb: Factor out tdb_lock_covered_by_allrecord_lock from 
tdb_lock_list
   via  26b8545 tdb: Simplify logic in tdb_lock_list slightly
   via  0f4e7a1 tdb: Slightly simplify tdb_lock_list
   via  116ec13 tdb: Fix blank line endings
   via  7237fdd tdb: Fix a comment
   via  d2b852d tdb: Fix a typo
   via  2c3fd8a tdb: Fix a missing CONVERT
  from  2148d86 Fix bug #9196 - defer_open is triggered multiple times on 
the same request.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit a444bb95a270ca5b331041c11a7e785c1e0559b7
Author: Volker Lendecke v...@samba.org
Date:   Fri Dec 14 16:07:11 2012 +0100

tdb: Add a comment explaining the check

I had to ask git blame to find why we have to do it here...

Reviewed-by: Rusty Russell ru...@samba.org
Reviewed-by: Stefan Metzmacher me...@samba.org

Autobuild-User(master): Stefan Metzmacher me...@samba.org
Autobuild-Date(master): Fri Dec 21 13:54:39 CET 2012 on sn-devel-104

commit 3109b541c9b2f0063e1ccb0cdaec0a8e388b29b4
Author: Volker Lendecke v...@samba.org
Date:   Fri Dec 14 15:53:08 2012 +0100

tdb: Make tdb_new_database() follow a more conventional style

We usually goto fail on every error and then in normal flow set the
return variable to success. This patch removes a comment which from my
point of view is now obsolete. It violates the {} rule from README.Coding
here in favor of the style used in this function.

Reviewed-by: Rusty Russell ru...@samba.org
Reviewed-by: Stefan Metzmacher me...@samba.org

commit d972e6fa74b6499403d4c3d3c6a84cbda7eded39
Author: Volker Lendecke v...@samba.org
Date:   Fri Dec 14 14:50:08 2012 +0100

tdb: Fix a typo

Reviewed-by: Rusty Russell ru...@samba.org
Reviewed-by: Stefan Metzmacher me...@samba.org

commit c04de8f3a4deba0062f8cdbcbe74d3735a80b735
Author: Volker Lendecke v...@samba.org
Date:   Fri Dec 14 14:48:31 2012 +0100

tdb: Fix a typo

Reviewed-by: Rusty Russell ru...@samba.org
Reviewed-by: Stefan Metzmacher me...@samba.org

commit 24755d75b0ee7170195bc26cf28bab4ffdb6f752
Author: Volker Lendecke v...@samba.org
Date:   Fri Dec 14 09:24:06 2012 +0100

tdb: Use tdb_lock_covered_by_allrecord_lock in tdb_unlock

Reviewed-by: Rusty Russell ru...@samba.org
Reviewed-by: Stefan Metzmacher me...@samba.org

commit f8dafe5685008671f4f983a4defc90b4a05cf992
Author: Volker Lendecke v...@samba.org
Date:   Fri Dec 14 09:21:42 2012 +0100

tdb: Factor out tdb_lock_covered_by_allrecord_lock from tdb_lock_list

Reviewed-by: Rusty Russell ru...@samba.org
Reviewed-by: Stefan Metzmacher me...@samba.org

commit 26b8545df44df7e60ba0ba7336ffbdda8a14e423
Author: Volker Lendecke v...@samba.org
Date:   Thu Dec 13 22:14:34 2012 +0100

tdb: Simplify logic in tdb_lock_list slightly

Reviewed-by: Rusty Russell ru...@samba.org
Reviewed-by: Stefan Metzmacher me...@samba.org

commit 0f4e7a1401998746a6818b9469ab369d70418ac1
Author: Volker Lendecke v...@samba.org
Date:   Thu Dec 13 21:58:00 2012 +0100

tdb: Slightly simplify tdb_lock_list

Avoid an else {} branch when we can do an early return

Reviewed-by: Rusty Russell ru...@samba.org
Reviewed-by: Stefan Metzmacher me...@samba.org

commit 116ec13bb0718eb1de1ac1f4410d5c33f1db616f
Author: Volker Lendecke v...@samba.org
Date:   Thu Dec 13 13:31:59 2012 +0100

tdb: Fix blank line endings

Reviewed-by: Rusty Russell ru...@samba.org
Reviewed-by: Stefan Metzmacher me...@samba.org

commit 7237fdd4ddc0b9c848b5936431b4f8731ce56dba
Author: Volker Lendecke v...@samba.org
Date:   Fri Dec 14 08:01:12 2012 +0100

tdb: Fix a comment

Reviewed-by: Rusty Russell ru...@samba.org
Reviewed-by: Stefan Metzmacher me...@samba.org

commit d2b852d79bd83754d8952a0e3dece00e513549f2
Author: Volker Lendecke v...@samba.org
Date:   Thu Dec 13 12:36:29 2012 +0100

tdb: Fix a typo

Reviewed-by: Rusty Russell ru...@samba.org
Reviewed-by: Stefan Metzmacher me...@samba.org

commit 2c3fd8a13e7dde23a23404cd88078a04c8b338ea
Author: Volker Lendecke v...@samba.org
Date:   Tue Dec 11 21:04:58 2012 +0100

tdb: Fix a missing CONVERT

methods-tdb_write expects data in on-disk format. For reading that
record, methods-tdb_read() has taken care of the on-disk to in-memory
representation according to the DOCONV() flag passed down. tdb_rec_write()
is a wrapper around methods-tdb_write just doing the CONVERT() on the
way to disk.

Reviewed-by: Rusty 

autobuild: intermittent test failure detected

2012-12-21 Thread autobuild
The autobuild test system has detected an intermittent failing test in 
the current master tree.

The autobuild log of the failure is available here:

   http://git.samba.org/autobuild.flakey/2012-12-21-1531/flakey.log

The samba3 build logs are available here:

   http://git.samba.org/autobuild.flakey/2012-12-21-1531/samba3.stderr
   http://git.samba.org/autobuild.flakey/2012-12-21-1531/samba3.stdout

The source4 build logs are available here:

   http://git.samba.org/autobuild.flakey/2012-12-21-1531/samba.stderr
   http://git.samba.org/autobuild.flakey/2012-12-21-1531/samba.stdout
  
The top commit at the time of the failure was:

commit a444bb95a270ca5b331041c11a7e785c1e0559b7
Author: Volker Lendecke v...@samba.org
Date:   Fri Dec 14 16:07:11 2012 +0100

tdb: Add a comment explaining the check

I had to ask git blame to find why we have to do it here...

Reviewed-by: Rusty Russell ru...@samba.org
Reviewed-by: Stefan Metzmacher me...@samba.org

Autobuild-User(master): Stefan Metzmacher me...@samba.org
Autobuild-Date(master): Fri Dec 21 13:54:39 CET 2012 on sn-devel-104


[SCM] Samba Shared Repository - branch master updated

2012-12-21 Thread Günther Deschner
The branch, master has been updated
   via  b1548fd s3-prefork: Directly fail if tevent_req_is_unix_error() 
fails.
   via  93d2847 s3-libsmb: Remove check if array is NULL.
   via  56eb4ab s3-rpc_server: Fix username and remote check.
   via  bc3edaa s4-libcli: Use a do-while loop.
   via  9c273d5 s3-lib: Cleanup transfer_file_internal() a bit.
   via  e4649da libgpo: Make it clear that we want to fall trough here.
   via  53f5443 s4-dsdb: Make it clear that we want to fall trough here.
   via  ce25c48 s3-rpc_server: Make it clear we want to fall trough here.
   via  3f899da s3-lib: Make it clear that we want to fall trough here.
   via  96de3e7 s3-netapi: Add missing break in NetUserSetInfo_r().
   via  f7d8aa7 s3-libsmb: Fix a possible null pointer dereference.
   via  fd6041a2 s3-rpc_server: Fix null pointer derefs in 
rpc_pipe_open_interface().
   via  6168d95 s3-winbind: Fix null pointer dereference in 
store_memory_creds().
   via  9631e5b s3-vfs: Fix a null pointer deferference in 
vfs_media_harmony.
   via  72e02c7 s3-rpc_server: Fix a possible null pointer dereference.
   via  f0454ff s3-vfs: Fix typo in readonly_connect().
   via  3bf3ab4 libcli: Fix smb2cli_ioctl_send() if clause.
   via  f8a5abf libwbclient: Fix null check in process_domain_info_string().
   via  b26a9ea s3-rpc_server: Fix useless check if we still have a valid 
string.
   via  d0e2099 s3-libads: Fix copypaste error in ads_keytab_add_entry().
   via  3bd8c7d s3-lib: Fix push_ucs2() for-loop.
   via  7f8c8d8 s3-tldap: Fix dead code in tldap_sasl_bind_send().
   via  7937a6a s4-librpc: Remove dead code in smb_send_request().
   via  568bade krb5_wrap: Remove dead code in smb_krb5_renew_ticket().
   via  24a897f nsswitch: Fix wbclient BAIL macros.
   via  9981b85 libcli: Check schannel state return value of 
tdb_transaction_commit().
   via  e41f0cc s3-utils: Check return value of secrets_init().
   via  15c0594 s3-net: Check return values of push_reg_sz().
   via  5b1d950 param: Correctly create directory and create common 
function.
   via  426bcdb librpc: Check return codes of ndr functions.
   via  4d02e86 ndr: Check return code of ndr_pull_advance().
   via  e3eaeb9 s4-libnet: Checkr return codes in 
samsync_ldb_handle_domain().
   via  3000fc2 s3-nmbd: Check if we created the directories correctly.
   via  6fd4724 s3-eventlog: Make sure the eventlog directory exists.
   via  ae6947c s4-regsitry: Check return value of ldb_msg_add_empty().
   via  a3bbf1b s3-winbind: Check if we created the directories correctly.
   via  e136b95 s4-lib: Use directory_create_or_exist() to create messaging 
dir.
   via  3dda917 s3-smbd: Check return code of SMB_VFS_{L}STAT.
   via  8631a90 s4-client: Check return codes in do_connect().
  from  a444bb9 tdb: Add a comment explaining the check

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit b1548fd944578d845c5aaf88a528cf5a60df0c62
Author: Andreas Schneider a...@samba.org
Date:   Thu Dec 13 14:18:02 2012 +0100

s3-prefork: Directly fail if tevent_req_is_unix_error() fails.

Found by Coverity.

Signed-off-by: Andreas Schneider a...@samba.org
Reviewed-by: Günther Deschner g...@samba.org

Autobuild-User(master): Günther Deschner g...@samba.org
Autobuild-Date(master): Fri Dec 21 15:38:19 CET 2012 on sn-devel-104

commit 93d2847bf4cc5d2fcdc95677d1cb1c515adc621c
Author: Andreas Schneider a...@samba.org
Date:   Wed Dec 19 14:10:05 2012 +0100

s3-libsmb: Remove check if array is NULL.

rdata is an array with data. rdlength defines how big rdata is. So if
rdlength is not set we have a big problem.

Found by Coverity.

Signed-off-by: Andreas Schneider a...@samba.org
Reviewed-by: Günther Deschner g...@samba.org

commit 56eb4ab5f6280aa40c0e0edefad7f965b3f02a4a
Author: Andreas Schneider a...@samba.org
Date:   Wed Dec 19 11:20:50 2012 +0100

s3-rpc_server: Fix username and remote check.

Found by Coverity.

Signed-off-by: Andreas Schneider a...@samba.org
Reviewed-by: Günther Deschner g...@samba.org

commit bc3edaa6ad1a511075a97eab0bbb19a26b2288d2
Author: Andreas Schneider a...@samba.org
Date:   Wed Dec 19 10:37:08 2012 +0100

s4-libcli: Use a do-while loop.

Found by Coverity.

Signed-off-by: Andreas Schneider a...@samba.org
Reviewed-by: Günther Deschner g...@samba.org

commit 9c273d5ca1810da8cf03a2af78b3fa5cbaaf2df7
Author: Andreas Schneider a...@samba.org
Date:   Tue Dec 18 17:21:14 2012 +0100

s3-lib: Cleanup transfer_file_internal() a bit.

Signed-off-by: Andreas Schneider a...@samba.org
Reviewed-by: Günther Deschner g...@samba.org

commit e4649da0c72c3ec37c8a6a3920308f3ebcb1473e
Author: Andreas Schneider a...@samba.org
Date:   

[SCM] Samba Shared Repository - branch master updated

2012-12-21 Thread Jeremy Allison
The branch, master has been updated
   via  c1fb37d Recent coverity changes added directory_create_or_exist() 
checks to many directories.
  from  b1548fd s3-prefork: Directly fail if tevent_req_is_unix_error() 
fails.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit c1fb37d7bec1dd720f3eccbd0b490b6a335ca288
Author: Jeremy Allison j...@samba.org
Date:   Fri Dec 21 15:16:10 2012 -0800

Recent coverity changes added directory_create_or_exist() checks to many 
directories.

These may not be needed, but in the meantime - ensure make test works 
again
by chmod'ing the created test directories from 0777 to 0755.

Reviewed-By: Andrew Bartlett abart...@samba.org
Signed-off-by: Jeremy Allison j...@samba.org

Autobuild-User(master): Jeremy Allison j...@samba.org
Autobuild-Date(master): Sat Dec 22 02:08:33 CET 2012 on sn-devel-104

---

Summary of changes:
 selftest/target/Samba3.pm |7 +++
 selftest/target/Samba4.pm |6 ++
 2 files changed, 13 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index ea2e21d..adca52f 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -765,6 +765,13 @@ sub provision($$)
mkdir($_, 0777) foreach(@dirs);
 
##
+   ## lockdir and piddir must be 0755
+   ##
+   chmod 0755, $lockdir;
+   chmod 0755, $piddir;
+
+
+   ##
## create ro and msdfs share layout
##
 
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 5988b83..ba37504 100644
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -555,6 +555,12 @@ sub provision_raw_step1($$)
 
mkdir($_, 0777) foreach (@{$ctx-{directories}});
 
+   ##
+   ## lockdir and piddir must be 0755
+   ##
+   chmod 0755, $ctx-{lockdir};
+   chmod 0755, $ctx-{piddir};
+
unless (open(CONFFILE, $ctx-{smb_conf})) {
warn(can't open $ctx-{smb_conf}$?);
return undef;


-- 
Samba Shared Repository