[PATCH] Fix confusing debug about rlimit_max

David Mulder dmulder at suse.com
Thu Feb 7 21:42:32 UTC 2019


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.
>
-- 
David Mulder
SUSE Labs Software Engineer - Samba
dmulder at suse.com
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)




More information about the samba-technical mailing list