[PATCH] Fix confusing debug about rlimit_max

Mikhail Novosyolov m.novosyolov at rosalinux.ru
Fri Feb 8 02:27:32 UTC 2019


I forgot to change the same text in 
ctdb/tests/eventscripts/50.samba.monitor.110.sh, 
ctdb/tests/eventscripts/50.samba.monitor.111.sh and 
ctdb/tests/eventscripts/stubs/testparm.
Now I've synced it with previous changes to source3/param/loadparm.c

Merge request: https://gitlab.com/samba-team/samba/merge_requests/244

08.02.2019 0:42, David Mulder via samba-technical пишет:
> LGTM
>
> On 2/7/19 11:29 AM, Mikhail Novosyolov via samba-technical wrote:
>> 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.
>>



More information about the samba-technical mailing list