[PATCH] Fix confusing debug about rlimit_max
Mikhail Novosyolov
m.novosyolov at rosalinux.ru
Thu Feb 7 18:29:53 UTC 2019
07.02.2019 17:59, Mikhail Novosyolov via samba-technical пишет:
> Hello everyone!
>
> ulimit 'open files' was 1024 on my system, and Samba 4.9.4 printed:
>
> "rlimit_max: increasing rlimit_max (1024) to minimum Windows limit
> (16384)"
>
> I've grepped Samba's code for 'rlimit_max' and found that the only
> code with it is
> https://gitlab.com/samba-team/samba/blob/master/source3/param/loadparm.c#L310
>
>
> if (sysctl_max < MIN_OPEN_FILES_WINDOWS) {
> DEBUG(2,("max_open_files: increasing sysctl_max (%d) to "
> "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: increasing rlimit_max (%d) to "
> "minimum Windows limit (%d)\n",
> rlimit_max,
> MIN_OPEN_FILES_WINDOWS));
> rlimit_max = MIN_OPEN_FILES_WINDOWS;
> }
>
> return MIN(sysctl_max, rlimit_max);
> ----------------------------------------------------------------------------------
>
>
> Both rlimit_max and MIN_OPEN_FILES_WINDOWS are set as variables but
> are never actually used anywhere else in the code.
>
> Also, the message "increasing rlimit_max" seems to be confusing: is it
> really increasing the limit? I see that only variable rlimit_max
> changes its value and nothing else happens.
>
I have made a patch which makes these debug messages clearer. Please
check if it is correct and apply it.
Last change to this text was made by commit
1fbb3f25e972f81aa8322ca69371956789572aea
(https://gitlab.com/samba-team/samba/commit/1fbb3f25e972f81aa8322ca69371956789572aea),
let's make a bit more clear. Hope that I've understood it correctly.
Also, I hope that writing about ulimit will be correct for all UNIX
platforms.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ROSA-Clearer-debug-about-ulimits.patch
Type: text/x-patch
Size: 1250 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190207/36d762ef/ROSA-Clearer-debug-about-ulimits.bin>
More information about the samba-technical
mailing list