Re: [PATCH] net: Disambiguate kernel message

From: Arun Sharma
Date: Tue Jan 31 2012 - 13:16:00 EST


On Mon, Jan 30, 2012 at 08:22:03PM -0800, Bjorn Helgaas wrote:
> > We print a different message depending on whether we're out
> > of TCP memory or there are too many orphan sockets.
>
> This patch mentions pairs of messages that are almost the same, but
> not quite. If they're supposed to be different, I'd suggest making
> them clearly different. As it is, the differences look like careless
> mistakes:

Good point. Updated patch changes the existing printks to be
the same as well.

On 1/31/12 12:51 AM, Christoph Paasch wrote:

>> --- a/net/ipv4/tcp.c
>> +++ b/net/ipv4/tcp.c
>> @@ -2015,10 +2015,22 @@ adjudge_to_death:
>> }
>> if (sk->sk_state != TCP_CLOSE) {
>> sk_mem_reclaim(sk);
>> - if (tcp_too_many_orphans(sk, 0)) {
>> + bool too_many_orphans = tcp_too_many_orphans(sk, 0);
>> + bool out_of_socket_memory = tcp_out_of_memory(sk);
>
> This introduces a compiler warning because you have the declarations
> after the code (sk_mem_reclaim()):
>

Fixed by the patch below.

-Arun