max_open_files

Luke Kenneth Casson Leighton lkcl at switchboard.net
Mon Feb 8 01:47:31 GMT 1999


argh, how horrible.  fixed.  moved get_myname outside (prior to
reload_services) to fix the _other_ bug in this area.

On Mon, 8 Feb 1999, Benjamin Kuit wrote:

> This might be a bug ..
> 
> samba/smbd/service.c
> 
>    617          init_structs();
>    618
>    619          if (!reload_services(False))
>    620                  return(-1);
> 
> init_structs eventually has file_init() called, which uses
> Globals.max_open_files to set real_max_open_files, a static
> int in smbd/files.c.
> 
> The problem is that Globals.max_open_files is only set to
> MAX_OPEN_FILES by init_globals, which is first (and only?)
> called through reload_services(), the result is that
> smbd/files.c:real_max_open_files is set to 0.
> 
> Surprisingly enough, on my system isn't stopping files being opened,
> probably because the limit is set to maxfiles+FUDGEFACTOR and I'm not
> using it in a large system, but it does cause a problem in the call
> to file_new(), which has the calculation:
> 
> 64      first_file = (getpid() ^ (int)time(NULL)) % real_max_open_files;
> 
> Since real_max_open_files = 0, the daemon dies of an Arithmetic Exception.
> 
> This was causing my roaming profile problem, and probably some others that
> I was ignoring.
> 
> Bj
> 
> +-------------------------------+--------------------------------------+
> |      Benjamin (Bj) Kuit       |  Faculty Of Mathematical             |
> |      Systems Programmer       |          and Computing Sciences.     |
> |      Phone: 02 9514 1841      |  University of Technology, Sydney    |
> |      Mobile: 0412 182 972     |  bj at mcs.uts.edu.au                   |
> +-------------------------------+--------------------------------------+
> 

<a href="mailto:lkcl at samba.anu.edu.au" > Luke Kenneth Casson Leighton  </a>
<a href="http://mailhost.cb1.com/~lkcl"> Samba and Network Development </a>
<a href="http://www.samba.co.uk"       > Samba and Network Consultancy </a>



More information about the samba-technical mailing list