From: Ilpo Järvinen Date: Thu, 3 May 2007 10:30:34 +0000 (-0700) Subject: [TCP]: Use S+L catcher only with SACK for now X-Git-Tag: v2.6.22-rc1~1036^2~36 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ec96822d5c0df77107c03b8d9a81a436ab707fc;p=linux-2.6 [TCP]: Use S+L catcher only with SACK for now TCP has a transitional state when SACK is not in use during which this invariant is temporarily broken. Without SACK, tcp_clean_rtx_queue does not decrement sacked_out. Therefore calls to tcp_sync_left_out before sacked_out is again corrected by tcp_fastretrans_alert can trigger this trap as sacked_out still has couple of segments that are already out of window. Signed-off-by: Ilpo Järvinen Signed-off-by: David S. Miller --- diff --git a/include/net/tcp.h b/include/net/tcp.h index ef8f9d4dae..e22b4f0305 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -736,7 +736,8 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk) static inline void tcp_sync_left_out(struct tcp_sock *tp) { - BUG_ON(tp->sacked_out + tp->lost_out > tp->packets_out); + BUG_ON(tp->rx_opt.sack_ok && + (tp->sacked_out + tp->lost_out > tp->packets_out)); tp->left_out = tp->sacked_out + tp->lost_out; }