Subject: Re: [PATCH net] net:sysctl fix the confusing corner of tcp_mem

From: Hanjun Guo <[email-masked]>
Date: Mon, 21 Dec 2015 09:02:20 +0800

Hi Eric,

On 2015/12/10 0:38, Eric W. Biederman wrote:
> Wang Yufen <[email-masked]> writes:
>
>> From: Yufen Wang <[email-masked]>
>>
>> I tried on linux-4.1:
>>     linux:~# cat /proc/sys/net/ipv4/tcp_mem 
>>     8388608	12582912	16777216
>>     linux:~# echo 1234 >/proc/sys/net/ipv4/tcp_mem 
>>     -bash: echo: write error: Invalid argument
>>     linux:~# cat /proc/sys/net/ipv4/tcp_mem 
>>     1234	12582912	16777216
>>
>> the echo operation got error, but value already written to tcp_mem.
>> If a write() returns an error like EINVAL, we expect no change occurred.
>> This patch fix the confusing corner and makes __do_proc_doulongvec_minmax 
>> works the same as __do_proc_dointvec
> Nacked-by: "Eric W. Biederman" <[email-masked]>
>
> Except for possibly breaking your muscle memory this does not explain
> why this is a problem.

I think it's really confusing that we got write error but actually the
value echoed is written properly, at least we need to fix it and make
the result match the behavior, right?

>
> Further you are changing a whole lot more than tcp_mem, without a word
> of justification in your description.

I agree, we can update the change log.

Thanks
Hanjun