From patchwork Thu Apr 1 23:19:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 12179817 X-Patchwork-Delegate: kuba@kernel.org Return-Path: 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 CAC9AC433ED for ; Thu, 1 Apr 2021 23:19:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C20161106 for ; Thu, 1 Apr 2021 23:19:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235749AbhDAXT4 (ORCPT ); Thu, 1 Apr 2021 19:19:56 -0400 Received: from mga14.intel.com ([192.55.52.115]:18940 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234850AbhDAXTx (ORCPT ); Thu, 1 Apr 2021 19:19:53 -0400 IronPort-SDR: 4IyUqnDE7f40EHpw1iKwgBixkXEwC1RGvMo8PgcvbEbemMszep1d6++24GzUPAmn2dEtwv8Ial eX0r8nrY9UtA== X-IronPort-AV: E=McAfee;i="6000,8403,9941"; a="191829881" X-IronPort-AV: E=Sophos;i="5.81,298,1610438400"; d="scan'208";a="191829881" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2021 16:19:53 -0700 IronPort-SDR: DXN6dwrGaOqhNBgjaIECa0VeQkB1sHgL1L/fA+wkk68G+Dgpbr8gkRinkjkYM9D3joK4jwzxOW YlH0KHiY1Hdg== X-IronPort-AV: E=Sophos;i="5.81,298,1610438400"; d="scan'208";a="446269194" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.252.128.105]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2021 16:19:53 -0700 From: Mat Martineau To: netdev@vger.kernel.org Cc: Paolo Abeni , davem@davemloft.net, kuba@kernel.org, matthieu.baerts@tessares.net, mptcp@lists.linux.dev, Mat Martineau Subject: [PATCH net-next 3/7] mptcp: remove unneeded check on first subflow Date: Thu, 1 Apr 2021 16:19:43 -0700 Message-Id: <20210401231947.162836-4-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210401231947.162836-1-mathew.j.martineau@linux.intel.com> References: <20210401231947.162836-1-mathew.j.martineau@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Paolo Abeni Currently we explicitly check for the first subflow being NULL in a couple of places, even if we don't need any special actions in such scenario. Just drop the unneeded checks, to avoid confusion. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau --- net/mptcp/options.c | 2 +- net/mptcp/protocol.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 69cafaacc31b..68361d28dc67 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -952,7 +952,7 @@ bool mptcp_update_rcv_data_fin(struct mptcp_sock *msk, u64 data_fin_seq, bool us * should match. If they mismatch, the peer is misbehaving and * we will prefer the most recent information. */ - if (READ_ONCE(msk->rcv_data_fin) || !READ_ONCE(msk->first)) + if (READ_ONCE(msk->rcv_data_fin)) return false; WRITE_ONCE(msk->rcv_data_fin_seq, diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 0c916d48cad8..531ee24aa827 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -493,7 +493,7 @@ static bool mptcp_check_data_fin(struct sock *sk) u64 rcv_data_fin_seq; bool ret = false; - if (__mptcp_check_fallback(msk) || !msk->first) + if (__mptcp_check_fallback(msk)) return ret; /* Need to ack a DATA_FIN received from a peer while this side