Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp96708imm; Thu, 4 Oct 2018 18:55:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV62UrvR7tW0qzD2awldDo+GZ6/sNw/PAV3X/cCZeSEoUPQLAg0XLnh5HPwQX4xFjfxqISfBr X-Received: by 2002:a63:81c8:: with SMTP id t191-v6mr8114311pgd.399.1538704519287; Thu, 04 Oct 2018 18:55:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538704519; cv=none; d=google.com; s=arc-20160816; b=bfqegfLFefoUiim52jLeDNK0EU979wXLkQxar82+Q4hT3ictemQ0Ql/Tag6qV/tIiu 4KDFmJciOsKLO8/ur/De0ffDL4LYLHEeK7qofrTiyggUrkNrRatCQ9IWue2wIXdEjfzD 4MvIwoGNJw2OH2gIwJpMBiGt7UTC8rSu4tlLVOSddBpnejW6sT755evOvJY4WFe67wT+ CnxlbRPvaduj+oV0sCTD9cbMo6hHAQGXL40bQFr15tsSn6KXiEudharc9U2Hf024ndyy RX0zg85eUWXABOqWlm7VK6zvBaqySKtTPPleeKnkIL9btbY8IDb2TtakwbvsAqTdSOdd EWJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=szS8KVKMZYV6FEFvfDkQbxQrnMKZSsq9dCjT56XrX6I=; b=DQ09dyMy/IUUkfq/1/jsvLGk3FxMcGpoMaoyhAw8CH4CeWsOGYVhhI+s1kmzcxiNVf n/PQh/1RK+MAeRhz+Z9dPi6sihMpy+uRGPlPJvmUHt0nAq/qwBk2PTEzL3RJrfLWATAC iIPuSEUhKRZ7cq+EcSDnR47y1SIPHw/NpNNpLTe9l2My5aboLSWGZ2gelP7tdqRZZNgF GHlzx3TzNjg0oDJ+IMlUP9i+wGHFj2uLLQ62Y+G1KIHTLDFnagvuzU9brZwH8jF3At9a Rm49Z+naSrZJA1vfRPoCPOnXP6X3Dha7Zel6zJqkSjNp8z8/9vZlJGlzrylVAOqnPc5x 0tIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B16fUGvl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d37-v6si7251957pla.40.2018.10.04.18.55.04; Thu, 04 Oct 2018 18:55:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B16fUGvl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727302AbeJEIvX (ORCPT + 99 others); Fri, 5 Oct 2018 04:51:23 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:37972 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726674AbeJEIvW (ORCPT ); Fri, 5 Oct 2018 04:51:22 -0400 Received: by mail-io1-f67.google.com with SMTP id e2-v6so7827262ioh.5; Thu, 04 Oct 2018 18:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=szS8KVKMZYV6FEFvfDkQbxQrnMKZSsq9dCjT56XrX6I=; b=B16fUGvlWwHFu5qbvNceBJ8E5x9TF8Dz7kRUnFSCTtVfodI/cZGRKG74BuWrwoLiD4 WXGjxR2M0/2eTCPgEQkHlgXnj4HuMAzuOchMFIq5sTkN9tq5USZfwOl9u+YPZEMkHbG9 S1b5Edomj0DX3BUbqF/HtYYlsNWWw/alnr1AVt12AVkVK3xCBKhmuHT6pyD8hnSzb19y BJ65Wg8vmNhpIRO54g1w6OYScIOuvnXDiCqqgYKiMv3oX8M6lIRmr/B+/hLdm8UhiIEj EE1WF78hWXSBKbn6uQNVeNDvCniXkhyOysKDrTNPloD7ohjy3AlzaUn2CoFu5cU4W+Px qI6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=szS8KVKMZYV6FEFvfDkQbxQrnMKZSsq9dCjT56XrX6I=; b=fyZo+MXnBk1WzZvNO+3Ox8P6sFvpIAfQk9LhAipX0mf+Jaa+UiNbCEJ4n+Qgs068OE BjR0Zx6TDKFDgPSTP8E8RIp4IlgN0d3VgbDKh00SJLDdeqL+nW0j0h88lFVLtNX6AWSv E9AAh7bxY8OA1pAyHzEn92Y27hb95Bn4Uh6vkE+07qHiUe1TdudY/PayVqNv6khvi5GD eZslx8Dc+Gd1XhplCyRI1b7saRrc30TzptkTl82Z6d13JUrgOKfuDw5gYX4ztVbvcgAo 85CbsjWWaGMQy+rayGXYh4yo58YFLNdqBHS6CL++bF0o2vdygRX63g5q7vI7ksdr3R+7 Gr5g== X-Gm-Message-State: ABuFfoggQZjpWCVvAfAYnKDv6j2aAFbW0HFcZHDvwVIiLmWCab92Iwxe R0w6Zwv0tvVfeW1EmhDWvmTuU22BIY9maN7WXx8= X-Received: by 2002:a6b:c652:: with SMTP id w79-v6mr6002492iof.142.1538704496338; Thu, 04 Oct 2018 18:54:56 -0700 (PDT) MIME-Version: 1.0 References: <1538579279-11614-1-git-send-email-laoar.shao@gmail.com> <9863d8b1-7249-e5ec-0400-4007798e69e2@gmail.com> In-Reply-To: <9863d8b1-7249-e5ec-0400-4007798e69e2@gmail.com> From: Yafang Shao Date: Fri, 5 Oct 2018 09:54:20 +0800 Message-ID: Subject: Re: [PATCH net-next] inet: do not set backlog if listen fails To: Eric Dumazet Cc: Eric Dumazet , David Miller , netdev , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 3, 2018 at 11:41 PM Eric Dumazet wrote: > > > > On 10/03/2018 08:07 AM, Yafang Shao wrote: > > These two backlog members are not necessary set in inet_csk_listen_start(). > > Regarding sk_max_ack_backlog, it will be set in the caller inet_listen > > and dccp_listen_start. > > Regraing sk_ack_backlog, it is better to put it together with > > sk_max_ack_backlog in the same function and only set on success. > > > > Signed-off-by: Yafang Shao > > --- > > net/dccp/proto.c | 1 + > > net/ipv4/af_inet.c | 1 + > > net/ipv4/inet_connection_sock.c | 3 --- > > 3 files changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/net/dccp/proto.c b/net/dccp/proto.c > > index 875858c..34d48cd 100644 > > --- a/net/dccp/proto.c > > +++ b/net/dccp/proto.c > > @@ -959,6 +959,7 @@ int inet_dccp_listen(struct socket *sock, int backlog) > > err = dccp_listen_start(sk, backlog); > > if (err) > > goto out; > > + sk->sk_ack_backlog = 0; > > > This is racy, remember that dccp and tcp have lockless listeners. > > Do not change sk_ack_backlog after a TCP/DCCP socket is ready to accept new flows. Understood. Thanks for your explanation.