suspicious indentation in do_tcp_setsockopt
Subsystems (3)
RFC 1/1 suspicious indentation in do_tcp_setsockopt
What's the intent here ?
This ?
net/ipv4/tcp.c +2 -1
@@ -2454,10 +2454,11 @@ static int do_tcp_setsockopt(struct sock *sk, int level,case TCP_THIN_DUPACK :if (val <0 || val >1 ) err = -EINVAL ; -else +else { tp->thin_dupack = val;if (tp->thin_dupack)tcp_disable_early_retrans (tp); + }break ;case TCP_REPAIR :
Or this ...
net/ipv4/tcp.c +3 -2
@@ -2456,8 +2456,9 @@ static int do_tcp_setsockopt(struct sock *sk, int level, err = -EINVAL ; else tp->thin_dupack = val; -if (tp->thin_dupack) -tcp_disable_early_retrans (tp); + +if (tp->thin_dupack) +tcp_disable_early_retrans (tp);break ;case TCP_REPAIR :
I'll submit the right patch in the right form once I know what was intended.
The former seems more 'correct' to me, but I'm unsure if that could break something.
Dave
David Miller
maintainerFrom: Dave Jones <[email protected]>
Date: Thu, 5 Sep 2013 00:20:45 -0400
Quoted 1 line
What's the intent here ?
This stuff is great, do you have a script that looks for this false indentation pattern?
Quoted 7 lines · David Miller
From: Dave Jones <[email protected]>
Date: Thu, 5 Sep 2013 00:20:45 -0400Quoted 1 line
What's the intent here ?
This stuff is great, do you have a script that looks for this false indentation pattern?
Coverity. I'm doing daily builds with it now, in the hope of trying to catch things faster, but there's a *ton* of old stuff in there like this that needs sorting through, because it seems to have strange of notions of what a 'new' bug is.
Dave
Quoted 10 lines · Dave Jones
Quoted 7 lines · David Miller
From: Dave Jones <[email protected]>
Date: Thu, 5 Sep 2013 00:20:45 -0400Quoted 1 line
What's the intent here ?
This stuff is great, do you have a script that looks for this false indentation pattern?
Coverity.
Good stuff.
Quoted 4 lines
I'm doing daily builds with it now, in the hope of trying to catch things faster, but there's a *ton* of old stuff in there like this that needs sorting through, because it seems to have strange of notions of what a 'new' bug is.
I think scripts/coccinelle/misc/ifcol.cocci
does something similar.
Quoted 6 lines · Dave Jones
Quoted 5 lines · David Miller
From: Dave Jones <[email protected]>
Date: Thu, 5 Sep 2013 00:20:45 -0400Quoted 1 line
What's the intent here ?
Quoted 7 lines
Quoted 2 lines
This stuff is great, do you have a script that looks for this false indentation pattern?
Coverity. I'm doing daily builds with it now, in the hope of trying to catch things faster, but there's a *ton* of old stuff in there like this that needs sorting through, because it seems to have strange of notions of what a 'new' bug is.
Right, it seems 'new' is just newly *detected*, not necessarily newly introduced in recent code.
Quoted 1 line
Dave
(Adding Yuchung Cheng and Neal Cardwell as the
author and acker of the patch)
Quoted 3 lines · Dave Jones
What's the intent here ?
This ?
I think the first is most likely.
Quoted 50 lines
net/ipv4/tcp.c +2
-1@@ -2454,10 +2454,11 @@ static int do_tcp_setsockopt(struct sock *sk, int level,case TCP_THIN_DUPACK :if (val <0 || val >1 ) err = -EINVAL ; -else +else { tp->thin_dupack = val;if (tp->thin_dupack)tcp_disable_early_retrans (tp); + }break ;case TCP_REPAIR :Or this ...
net/ipv4/tcp.c +3
-2@@ -2456,8 +2456,9 @@ static int do_tcp_setsockopt(struct sock *sk, int level, err = -EINVAL ; else tp->thin_dupack = val; -if (tp->thin_dupack) -tcp_disable_early_retrans (tp); + +if (tp->thin_dupack) +tcp_disable_early_retrans (tp);break ;case TCP_REPAIR :I'll submit the right patch in the right form once I know what was intended.
The former seems more 'correct' to me, but I'm unsure if that could break something.
Dave
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Neal Cardwell
maintainerQuoted 9 lines · Joe Perches
(Adding Yuchung Cheng and Neal Cardwell as the
author and acker of the patch)Quoted 3 lines · Dave Jones
What's the intent here ?
This ?
I think the first is most likely.
Yes, exactly. The first version makes more sense. We only need to check thin_dupack and potentially disable early retransmit if the setsockopt successfully changes thin_dupack.
neal
Quoted 53 lines
Quoted 50 lines
net/ipv4/tcp.c +2
-1@@ -2454,10 +2454,11 @@ static int do_tcp_setsockopt(struct sock *sk, int level,case TCP_THIN_DUPACK :if (val <0 || val >1 ) err = -EINVAL ; -else +else { tp->thin_dupack = val;if (tp->thin_dupack)tcp_disable_early_retrans (tp); + }break ;case TCP_REPAIR :Or this ...
net/ipv4/tcp.c +3
-2@@ -2456,8 +2456,9 @@ static int do_tcp_setsockopt(struct sock *sk, int level, err = -EINVAL ; else tp->thin_dupack = val; -if (tp->thin_dupack) -tcp_disable_early_retrans (tp); + +if (tp->thin_dupack) +tcp_disable_early_retrans (tp);break ;case TCP_REPAIR :I'll submit the right patch in the right form once I know what was intended.
The former seems more 'correct' to me, but I'm unsure if that could break something.
Dave
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · Neal Cardwell
Quoted 6 lines · Joe Perches
(Adding Yuchung Cheng and Neal Cardwell as the
author and acker of the patch)Quoted 2 lines · Dave Jones
What's the intent here ?
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
This ?
I think the first is most likely.
Yes, exactly. The first version makes more sense. We only need to check
thin_dupackand potentially disable early retransmit if the setsockopt successfully changesthin_dupack.
ack. first version is the intended one. thanks.
Quoted 57 lines
neal
Quoted 53 lines
Quoted 50 lines
net/ipv4/tcp.c +2
-1@@ -2454,10 +2454,11 @@ static int do_tcp_setsockopt(struct sock *sk, int level,case TCP_THIN_DUPACK :if (val <0 || val >1 ) err = -EINVAL ; -else +else { tp->thin_dupack = val;if (tp->thin_dupack)tcp_disable_early_retrans (tp); + }break ;case TCP_REPAIR :Or this ...
net/ipv4/tcp.c +3
-2@@ -2456,8 +2456,9 @@ static int do_tcp_setsockopt(struct sock *sk, int level, err = -EINVAL ; else tp->thin_dupack = val; -if (tp->thin_dupack) -tcp_disable_early_retrans (tp); + +if (tp->thin_dupack) +tcp_disable_early_retrans (tp);break ;case TCP_REPAIR :I'll submit the right patch in the right form once I know what was intended.
The former seems more 'correct' to me, but I'm unsure if that could break something.
Dave
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html