[Samba] Samba 2.2.6 leaks file descriptions!

Noel Kelly nkelly at citrusnetworks.net
Tue Oct 29 09:40:01 GMT 2002


Is this a necessary update to all 2.2.6 installations with 2.4.x kernels?  I
am assuming that ./configure picks up the 'kernel change notify' code
automatically and compiles support for it in?

Thanks,
Noel

-----Original Message-----
From: jra at dp.samba.org [mailto:jra at dp.samba.org]
Sent: 28 October 2002 22:04
To: Joakim Tjernlund
Cc: Gerald (Jerry) Carter; samba at lists.samba.org
Subject: Re: [Samba] Samba 2.2.6 leaks file descriptions!


On Sun, Oct 27, 2002 at 06:47:33PM +0100, Joakim Tjernlund wrote:
> > > Been running with this change since friday and it looks good. I can
not
> > > find any leaking FDs anymore. The usage of the server has been very
low
> > > so I won't know for sure until Monday afternoon.
> > > 
> > > Does this mean it's a RH kernel bug?
> > 
> > It could either (a) be a bug in the linux kernel, necessarily specific
to 
> > RedHat, or (b) a bug in the way we use the kernel change notify
mechanism 
> > on linux.  Will take some more investigation to find out which.
> > 
> 
> Found one more, this file(MTP_UP_PA12.doc) has been open for 6 hours:

Ok, I've found and fixed the problems with 2.2.6 leaking file descriptors
when kernel change notify is turned on. Unfortunately (or fortunately as
we can fix this :-) it's a Samba bug, not a Linux kernel bug.

I've committed this to all CVS branches.

Jeremy.


Here is the patch :

Index: smbd/notify_kernel.c
===================================================================
RCS file: /data/cvs/samba/source/smbd/notify_kernel.c,v
retrieving revision 1.6.4.15
diff -u -r1.6.4.15 notify_kernel.c
--- smbd/notify_kernel.c        11 Jun 2002 03:25:50 -0000      1.6.4.15
+++ smbd/notify_kernel.c        28 Oct 2002 22:01:19 -0000
@@ -127,7 +127,6 @@
                BlockSignals(True, RT_SIGNAL_NOTIFY);
                for (i = 0; i < signals_received; i++) {
                        if (fd == (int)fd_pending_array[i]) {
-                               close(fd);
                                fd_pending_array[i] = (SIG_ATOMIC_T)-1;
                                if (signals_received - i - 1) {
                                        memmove((void
*)&fd_pending_array[i], (void *)&fd_pending_array[i+1],
@@ -138,6 +137,7 @@
                                break;
                        }
                }
+               close(fd);
                BlockSignals(False, RT_SIGNAL_NOTIFY);
        }
        SAFE_FREE(data);

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.404 / Virus Database: 228 - Release Date: 15/10/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.404 / Virus Database: 228 - Release Date: 15/10/2002
 



More information about the samba mailing list