Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp458805pxb; Fri, 29 Oct 2021 13:12:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrnTCc0sJ1ZcEiW59WJMMZsYzAZzv3QRweLTRgrGtMDONnsAjed81PXj+tmS9UKtjav1KO X-Received: by 2002:aa7:de8f:: with SMTP id j15mr17442505edv.347.1635538328730; Fri, 29 Oct 2021 13:12:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635538328; cv=none; d=google.com; s=arc-20160816; b=x5o1M3c5YcBXV9YhFuPz1SNiYqO7zG0GRoaL4w1o2QgCYEv80uo/UrERG3NnSkA4N2 6KpNBiVHUQjEeykLe/fEDsa0YANWpHkcSnf185IOUG4j57F2GDx7aFn6iir+lupPT7Lh xO0N7KPgxgojig3QVzujnqcc0WSN86JpYC5LoQfhqIfeQG1hE5dZm1+6SCbMv7374Mg/ ZOiiE3Jg4/NTsnq2+yty8kBK7N4mnrC56pUUukdQ9s0w9gZFlRo1fUUm1mw6MpxL+17L meuaYKtUMJUa44qMdJIPKVYg1qKnQ8D4Og/jTer4YOtGKormluHxgwbjcMAcSNEmk9rN oKsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=eMtveecgI90SRG5K27eePSGbPiTmYybj7DpXXOFWyq8=; b=FSqMFLzdBJzxfC0mdT9TQQpDZgprmxOkdOp5Ufg9EAfDqQZ58jiz/afvjc4mf8DmkD BDnT6h9I5LEcGyNr0U2t7AGURyup26zyaUPDUVuaJb3GNbNeKYgJSTL038j3qAmffONR 933Mxvt3A3cqTb0Mhfgl5iwMzxQ8fw5wmlbX9Sa80F2RxT4Yqx1EPnTSfSg4UJkI5SJ3 OPEZhXmENk3+J8yebc2eOCZORmp6zde56VqLry1c2q6IPN0BWcc+FqWEFKIrGIUbeuD/ 4mBB52GS6ZHxh6+ZS147MHV438UpVf/HDcbn1/d27kGfaBkW6I5TYsq7pe1sD3FQSfYa Lk1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="GMB/ahr7"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v8si10554234eda.402.2021.10.29.13.11.23; Fri, 29 Oct 2021 13:12:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="GMB/ahr7"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230287AbhJ2UNt (ORCPT + 99 others); Fri, 29 Oct 2021 16:13:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:41160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230313AbhJ2UNt (ORCPT ); Fri, 29 Oct 2021 16:13:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6595B6101E for ; Fri, 29 Oct 2021 20:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635538280; bh=i9UcOgdjH4k8J6GDr4ryir1Zi0f/eZpnYKcMfHznV24=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GMB/ahr7m/TUp8Zqyp48CMxBLRkNcDXZzTwXJROyaHJ2ijd0UIswYMMwLmP/BtPKD UgrefCWMeE7vfqASf5qx/QHBVRIUXlMG+rZ4Bc0dM3oOGJrQKoaRfWl8Oc7aK6bNZi wMtnSeexAq+H3pfIJPSQb+KGy+q97ecfc2Z+6D4LK063lMuT1odXEdUfmyWz0yfB8p cflEof9019Kjm02kDR230uzlZLXIHedGGi616mNcPIGHohqbq75QNmctXMtpTrpHsp r1CzMzRwvhMGhv/gfiwv7Pj7zKYPrSR9GPdQDfmemgaScBilgfmlnCwYtOrbfnZufs k/SlTJ+TZJAWQ== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH 4/4] SUNRPC: Prevent immediate close+reconnect Date: Fri, 29 Oct 2021 16:04:21 -0400 Message-Id: <20211029200421.65090-4-trondmy@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211029200421.65090-3-trondmy@kernel.org> References: <20211029200421.65090-1-trondmy@kernel.org> <20211029200421.65090-2-trondmy@kernel.org> <20211029200421.65090-3-trondmy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust If we have already set up the socket and are waiting for it to connect, then don't immediately close and retry. Signed-off-by: Trond Myklebust --- net/sunrpc/xprtsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 7fb302e202bc..ae48c9c84ee1 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -2314,7 +2314,7 @@ static void xs_connect(struct rpc_xprt *xprt, struct rpc_task *task) WARN_ON_ONCE(!xprt_lock_connect(xprt, task, transport)); - if (transport->sock != NULL) { + if (transport->sock != NULL && !xprt_connecting(xprt)) { dprintk("RPC: xs_connect delayed xprt %p for %lu " "seconds\n", xprt, xprt->reestablish_timeout / HZ); -- 2.31.1