Message ID | 20201031113501.703702684@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <SRS0=L2bx=EG=vger.kernel.org=stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7670C388F7 for <stable@archiver.kernel.org>; Sat, 31 Oct 2020 11:49:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9AFBF20731 for <stable@archiver.kernel.org>; Sat, 31 Oct 2020 11:49:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604144999; bh=fgousYZLKRtIMFXA2rAx+Eo+oB53Dy4D7PQho9usL18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=aoZ0l/W6FAWDsvPwPDGXc8VN7Zbuf0B05m0a2/ss2IWfIjn1qt2HhBLgryl5rsn6M TGAZwIOhonLwpNOD2T7fdmQOiFgxOuZ0UzLnu8tON1xGYGv3cIlqnzsGfjKYU//Lla j8p1LgxYL0/Myf/akC6FOqKk4/blHMjnV2AFHMAM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727747AbgJaLlz (ORCPT <rfc822;stable@archiver.kernel.org>); Sat, 31 Oct 2020 07:41:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:41152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727413AbgJaLlx (ORCPT <rfc822;stable@vger.kernel.org>); Sat, 31 Oct 2020 07:41:53 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 311FF20731; Sat, 31 Oct 2020 11:41:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604144512; bh=fgousYZLKRtIMFXA2rAx+Eo+oB53Dy4D7PQho9usL18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SkBljzl9LAJknnFJe3nwiiAjSBD+Z9s4JWvTVinBEyNnlar4RETvFpfrmb3wzaCYg A5TjZYe6mOO2AkRqF8pL9cITMGTpmtRUZQomRZtcHCdJJo1aBM/Mrbk74gGCQoFlG4 Dr+N3WXPKcXHJO1YHdOVHrZzWPGLTdgkBCnIvCgs= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Arjun Roy <arjunroy@google.com>, Soheil Hassas Yeganeh <soheil@google.com>, Neal Cardwell <ncardwell@google.com>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org> Subject: [PATCH 5.8 46/70] tcp: Prevent low rmem stalls with SO_RCVLOWAT. Date: Sat, 31 Oct 2020 12:36:18 +0100 Message-Id: <20201031113501.703702684@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201031113459.481803250@linuxfoundation.org> References: <20201031113459.481803250@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
--- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -483,6 +483,8 @@ static inline bool tcp_stream_is_readabl return true; if (tcp_rmem_pressure(sk)) return true; + if (tcp_receive_window(tp) <= inet_csk(sk)->icsk_ack.rcv_mss) + return true; } if (sk->sk_prot->stream_memory_read) return sk->sk_prot->stream_memory_read(sk); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -4790,7 +4790,8 @@ void tcp_data_ready(struct sock *sk) int avail = tp->rcv_nxt - tp->copied_seq; if (avail < sk->sk_rcvlowat && !tcp_rmem_pressure(sk) && - !sock_flag(sk, SOCK_DONE)) + !sock_flag(sk, SOCK_DONE) && + tcp_receive_window(tp) > inet_csk(sk)->icsk_ack.rcv_mss) return; sk->sk_data_ready(sk);