Package: smbfs
Version: 3.0.11-1
Severity: normal
Tags: patch

Recently, smbmount started to just hang after successfully mounting a
share. Google showed that others have reported this behaviour a long
time ago, with other versions of samba. 

One interesting hit that actually included a patch was
http://lists.samba.org/archive/samba/2003-November/001784.html

The described behaviour matches the facts I was able to observe with
strace.

Guess what, the patch applied (with some minor tweaking) to samba
3.0.11, and it actually solved my problem. So it looks like this
long-standing problem has not been fixed yet, and may have been
triggered by a recent kernel update.

Here is the patch, slightly modified to apply to samba 3.0.11:


diff -ur samba-3.0.11.orig/source/client/smbmount.c 
samba-3.0.11/source/client/smbmount.c
--- samba-3.0.11.orig/source/client/smbmount.c  2004-10-25 23:05:11.000000000 
+0200
+++ samba-3.0.11/source/client/smbmount.c       2005-04-18 15:49:45.000000000 
+0200
@@ -62,6 +62,11 @@
        exit(0);
 }
 
+static void parent_is_ready(int sig)
+{
+       /* just continue to execute - parent is ready to die :)) */
+}
+
 static void daemonize(void)
 {
        int j, status;
@@ -75,6 +80,13 @@
 
        if (child_pid > 0) {
                while( 1 ) {
+                       /*
+                        * Funny, isn't it? ;))
+                        * But children is pause()ing for this signal
+                        * to go and do preporly thing with parent.
+                        */
+                       kill(child_pid, SIGTERM);
+
                        j = waitpid( child_pid, &status, 0 );
                        if( j < 0 ) {
                                if( EINTR == errno ) {
@@ -92,6 +104,14 @@
                        exit(WEXITSTATUS(status));
        }
 
+       /*
+        * Sometimes parent stay in sys_fork() during children already 
kill()ing him!
+        * Deadlock in parent's code as result :(
+        * Wait for parent's SIGTERM to indicate it's readyness after 
sys_fork()ing.
+        */
+       signal( SIGTERM, parent_is_ready );
+       pause();
+
        signal( SIGTERM, SIG_DFL );
        chdir("/");
 }

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing'), (101, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.12-rc2
Locale: LANG=C, [EMAIL PROTECTED] (charmap=ISO-8859-15)

Versions of packages smbfs depends on:
ii  libc6                       2.3.2.ds1-21 GNU C Library: Shared libraries an
ii  libcomerr2                  1.37-2       common error description library
ii  libkrb53                    1.3.6-2      MIT Kerberos runtime libraries
ii  libldap2                    2.1.30-6     OpenLDAP libraries
ii  netbase                     4.21         Basic TCP/IP networking system
ii  samba-common                3.0.11-1     Samba common files used by both th

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to