public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH 2/2] tcp: fix FIN_WAIT2 timer expression in /proc/net/tcp
Date: Tue, 12 Feb 2013 06:57:50 -0800	[thread overview]
Message-ID: <1360681070.13993.2.camel@edumazet-glaptop> (raw)
In-Reply-To: <1360673668.10638.14.camel@ubuntu-vm-makita>

On Tue, 2013-02-12 at 21:54 +0900, Toshiaki Makita wrote:
> When tcp_fin_timeout is greater than 60, /proc/net/tcp shows
> FIN_WAIT2 keepalive timer as expires in (tcp_fin_timeout - 60)
> sec. This is confusing because the timer is not for keepalive
> and the socket needs another timewait timer to disappear.
> 
> Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
> ---
>  net/ipv4/tcp_ipv4.c |   23 +++++++++++++++--------
>  net/ipv6/tcp_ipv6.c |   23 +++++++++++++++--------
>  2 files changed, 30 insertions(+), 16 deletions(-)
> 
> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index 629937d..32bde0e 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -2656,17 +2656,24 @@ static void get_tcp4_sock(struct sock *sk, struct seq_file *f, int i, int *len)
>  	int rx_queue;
>  
>  	if (icsk->icsk_pending == ICSK_TIME_RETRANS) {
> -		timer_active	= 1;
> -		timer_expires	= icsk->icsk_timeout;
> +		timer_active		= 1;
> +		timer_expires		= icsk->icsk_timeout;
>  	} else if (icsk->icsk_pending == ICSK_TIME_PROBE0) {
> -		timer_active	= 4;
> -		timer_expires	= icsk->icsk_timeout;
> +		timer_active		= 4;
> +		timer_expires		= icsk->icsk_timeout;
>  	} else if (timer_pending(&sk->sk_timer)) {
> -		timer_active	= 2;
> -		timer_expires	= sk->sk_timer.expires;
> +		if (sk->sk_state == TCP_FIN_WAIT2 && sock_flag(sk, SOCK_DEAD)) {
> +			timer_active	= 3;
> +			timer_expires	= sk->sk_timer.expires +
> +					  (tp->linger2 >= 0 ?
> +					   TCP_TIMEWAIT_LEN : 0);
> +		} else {
> +			timer_active	= 2;
> +			timer_expires	= sk->sk_timer.expires;
> +		}
>  	} else {
> -		timer_active	= 0;
> -		timer_expires = jiffies;
> +		timer_active		= 0;
> +		timer_expires		= jiffies;
>  	}
>  

I find this patch confusing :

1) Please don't change the indentation for a bug fix

2) You add a new 'active=3' field, that some user space
reading /proc/net/tcp wont expect.

So the changelog is not matching the changes.

  reply	other threads:[~2013-02-12 14:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-12 12:49 [PATCH 0/2] tcp: fix problems when tcp_fin_timeout is greater than 60 Toshiaki Makita
2013-02-12 12:52 ` [PATCH 1/2] tcp: fix too short FIN_WAIT2 time out Toshiaki Makita
2013-02-12 12:54   ` [PATCH 2/2] tcp: fix FIN_WAIT2 timer expression in /proc/net/tcp Toshiaki Makita
2013-02-12 14:57     ` Eric Dumazet [this message]
2013-02-12 15:13       ` Eric Dumazet
2013-02-15  8:26         ` Toshiaki Makita

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360681070.13993.2.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=makita.toshiaki@lab.ntt.co.jp \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox