Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2755112imm; Wed, 3 Oct 2018 08:41:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV62bilQcXCm+8e8b7yUQUANlGIK0z2HtCl3Vwl52MQvo4px3mN+IXmJxVt+RESHeDK4XDg0g X-Received: by 2002:a63:3842:: with SMTP id h2-v6mr1898114pgn.300.1538581298383; Wed, 03 Oct 2018 08:41:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538581298; cv=none; d=google.com; s=arc-20160816; b=jSiI9tu8ivb/dF9fuuaCTq7IIOlZ5uDuVBErSs9vuYlmhVjU9AcMeLaJcMpJNqu5DE p/+kjB6mCY4aLMP+eNoYgpmzz8uKmW3wBQ8+I0apWQdPHKtXKV8QR0UfB/gfx7IbO/JM 6m0VGf14qdjBUvCNR1zVqA1di39OGfTsiCrlyfntVLXouJxtfGF0zNz1kJRV8jk5dxwF YBJeE+Rg0uVljeA+xQM4M/xyrig1odbGSKXlJEHcegN/NRLX5ySGhYKod5yvmHRkxxee 1qzXt/FZ5FSRbQ51Vt6E8/ypGRWPdx6zzQLBcR48LjFAA/FXFLcBalO/Z0mzrVA2ZhfT N53w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=rOSOJRmEP7qKdxzO+HTC72SVlqpsUVbiWKPUAvly+C0=; b=m1qfXLnsyRjpW1ZWC9CZ9D5ZKj40iUwFOgSwsuXSpv14kBGWmdQQeJqw0xMdTiRvU6 i3883uH6+m2wsTAQUK46BiF3rzSiWH0QJ/ILKxlbAoYTDHVRa9e6qkpkEc6WL1yMnYW4 hz33IZsS4ddXPMMayFCtM0bR1IujSIU5w5Y2q1TRVnO7UCC28YnDqusl4cBeBxoSrxVY KrwjiZFBXLaYAOC+amFxE5PNjbSKwDIL/OiKFbUvzIwSA8q00cF/uw1GGn4Kbio9HTw5 9ZG7V2NRyk5/jKo3/LgmM4Iocbp1H04a8xsm1Cl4uTeM95hpU7mjUAnPBKjgjFucbdhz NEkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=INnU9bNk; 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 r68-v6si2013189pfk.151.2018.10.03.08.41.21; Wed, 03 Oct 2018 08:41:38 -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=INnU9bNk; 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 S1726892AbeJCWaK (ORCPT + 99 others); Wed, 3 Oct 2018 18:30:10 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:37439 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726748AbeJCWaJ (ORCPT ); Wed, 3 Oct 2018 18:30:09 -0400 Received: by mail-pg1-f194.google.com with SMTP id c10-v6so1752958pgq.4; Wed, 03 Oct 2018 08:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=rOSOJRmEP7qKdxzO+HTC72SVlqpsUVbiWKPUAvly+C0=; b=INnU9bNk8bMHO2/CTIwV7yZArShcgWq5zWKB2oPM98AhhSMa6jCD+sGf7jEv9/DFwk ubs8+biQFLXk8plluDS+RutsnhHgDoWMnDwHAQrgulkMNVEqkl2H42T+fJbJV9nrMSFp BsJozFhH1i03C0x1vAn3z/lF/rWzJ++X6FN3I482x8I34WWlaYYbXqccedE8raRk4w9G RY49TBXOg71EQBbqG4n78HASYLzZMXaY6ekMl7OTzdDQRnNB+DuKDWIn8PBdGCJbWR7X QiMkTrlQeT+U5HDPUgYPXoS+ARa1QqoYwunXn35v1jH9S8PFYj4w+g6+p0Rgp842Hh1D v54A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rOSOJRmEP7qKdxzO+HTC72SVlqpsUVbiWKPUAvly+C0=; b=esPBX+hQoKpWFEGD148OIPxVdjZEher3EbgFmCglzM9b8BW77nmzIfFL6o7LxVlHzW pq9k8I69+oZhwKRoZjy4iVuM+2JCIKHKpSuXQDjv4LCGV+CWdCHtNunxZyN7SnRZ3atK dP4QFDVUvwE6x/q7yqK8y01CjP0vBZJmsnU2DV3+mSB011FE8lohXxo6Wax1Rd6dcp6o ekO+be1Cc3o0DRVzUyPjCKix2loZebhOU9CEhrq/0QYUz2hAmGzm9gEhaYpgydvdrZen MXE8rZ3I98E0XJDFUVz0B0Dur9LzQJsc6QR4hsRCm0/JyfHRkq35Gw9X1cynkpj25Ee9 zODA== X-Gm-Message-State: ABuFfohVdiuI39sOA7QV5R750ecpXIr1ZmmYmI5ZeCFHfTaPplC/1ek0 yJpQ1KlAwsclr3rjagMvstGSn1Eu X-Received: by 2002:a65:5188:: with SMTP id h8-v6mr1905329pgq.288.1538581274699; Wed, 03 Oct 2018 08:41:14 -0700 (PDT) Received: from ?IPv6:2620:15c:2c1:200:55c7:81e6:c7d8:94b? ([2620:15c:2c1:200:55c7:81e6:c7d8:94b]) by smtp.gmail.com with ESMTPSA id 70-v6sm3440866pfz.27.2018.10.03.08.41.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Oct 2018 08:41:14 -0700 (PDT) Subject: Re: [PATCH net-next] inet: do not set backlog if listen fails To: Yafang Shao , edumazet@google.com, davem@davemloft.net Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1538579279-11614-1-git-send-email-laoar.shao@gmail.com> From: Eric Dumazet Message-ID: <9863d8b1-7249-e5ec-0400-4007798e69e2@gmail.com> Date: Wed, 3 Oct 2018 08:41:13 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1538579279-11614-1-git-send-email-laoar.shao@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.