[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Dec 2 11:02:24 MST 2009


The branch, master has been updated
       via  b6fdecd... Fix bug #6837 - "Too many open files" when trying to access large number of files from Windows 7. Original patch by me fixed up with the correct open files number by jmaggard10 at hotmail.com. Jeremy.
      from  5f60855... samba-spoolss: use spoolss_StringArray2 in spoolss_EnumPrinterKey.

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


- Log -----------------------------------------------------------------
commit b6fdecd11210a3d2ff803bdc315aacd9f8b445a1
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Dec 2 10:01:14 2009 -0800

    Fix bug #6837 - "Too many open files" when trying to access large number of files
    from Windows 7. Original patch by me fixed up with the correct open files number
    by jmaggard10 at hotmail.com.
    Jeremy.

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

Summary of changes:
 source3/include/local.h  |   20 +++++++++++++++++++-
 source3/param/loadparm.c |   16 ++++++++++++++++
 source3/smbd/files.c     |    2 --
 3 files changed, 35 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/local.h b/source3/include/local.h
index 45767ad..de54ea5 100644
--- a/source3/include/local.h
+++ b/source3/include/local.h
@@ -66,7 +66,25 @@
 #ifndef MAX_OPEN_FILES
 #define MAX_OPEN_FILES 10000
 #endif
- 
+
+/*
+ * Fudgefactor required for open tdb's, etc.
+ */
+
+#ifndef MAX_OPEN_FUDGEFACTOR
+#define MAX_OPEN_FUDGEFACTOR 20
+#endif
+
+/*
+ * Minimum number of open files needed for Windows7 to
+ * work correctly. A little conservative but better that
+ * than run out of fd's.
+ */
+
+#ifndef MIN_OPEN_FILES_WINDOWS
+#define MIN_OPEN_FILES_WINDOWS 1050
+#endif
+
 #define WORDMAX 0xFFFF
 
 /* the maximum password length before we declare a likely attack */
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index a1f5328..3d426ec 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -4739,6 +4739,22 @@ static int max_open_files(void)
 #endif
 #endif
 
+	if (sysctl_max < MIN_OPEN_FILES_WINDOWS) {
+		DEBUG(2,("max_open_files: sysctl_max (%d) below "
+			"minimum Windows limit (%d)\n",
+			sysctl_max,
+			MIN_OPEN_FILES_WINDOWS));
+		sysctl_max = MIN_OPEN_FILES_WINDOWS;
+	}
+
+	if (rlimit_max < MIN_OPEN_FILES_WINDOWS) {
+		DEBUG(2,("rlimit_max: rlimit_max (%d) below "
+			"minimum Windows limit (%d)\n",
+			rlimit_max,
+			MIN_OPEN_FILES_WINDOWS));
+		rlimit_max = MIN_OPEN_FILES_WINDOWS;
+	}
+
 	return MIN(sysctl_max, rlimit_max);
 }
 
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index 2bc5ba6..455666f 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -171,8 +171,6 @@ void file_close_pid(uint16 smbpid, int vuid)
  Initialise file structures.
 ****************************************************************************/
 
-#define MAX_OPEN_FUDGEFACTOR 20
-
 void file_init(void)
 {
 	int request_max_open_files = lp_max_open_files();


-- 
Samba Shared Repository


More information about the samba-cvs mailing list