Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3213812pxb; Mon, 9 Nov 2020 05:46:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJydiXhIPuz8C3uNEzJb9XCa2WUPtWeL3CMc6LYacK5VdP+Mi9Pv7/AKBIJnEgiXshtF3LYL X-Received: by 2002:a50:9f2b:: with SMTP id b40mr15305580edf.20.1604929565779; Mon, 09 Nov 2020 05:46:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604929565; cv=none; d=google.com; s=arc-20160816; b=C3jrwzH8bxTQ1wY6Vp0+f9giYmDtuRrUp5HmwudJ7/Zu0g9iegGFk5c5+/tfCk7FXB o8P7nV1U4Qwydrr4nrCOtJuGHsORjR2e/3kD1m/5nFM/ARQS3AyAdOlz8KQdrpMSOeGR dsfb5kbUW3wobn88eI+yAycEVek5S+tWoSYmgvQOrLXndnkPK6wXlw+VRQn6VqAAPkaY kWxA+m9BppEs4aHmVJwfS4E6olHu/uHEsBIFn2z3K6a4eXLhzg3iCtIw32Fz7DzBwUvm oBMZe5/J0EjWKdZ9wV36s7MziyjwaOXy+r30YBmDi5M7vqs/armu9qTUwidPi8fCwIWu YoVA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UX3vWhO/b4zKez7+efk/oCWf2PLUnMkAbd6a7NIJYUY=; b=UnbyeKs5vvMrBy1KQGUzc7Y4/sHv27GEzGIJX+ts9FhE4nix8QfWBelTSBMJgshJjx JEVbTAq5Z5N5y/S8+0yE1f5jO/mBVfrKWvOlyuJbgzvu+3ZnSJrIdubOZtg7ARZPrhxI WZUA39yRj091tKAtWtfCON+P0cbg7i+bAMBBTpK2XCDDMSRnhc6YwQWKqVSickoRajbd s5cyFFkkFDsUc0EgEcYGDJq7lrfyTui+1BmUXze4hWatAqgHJtjv0cVXEaPcawtXu31W mwG1YLD8z22HnGSaV/nP1KtPfN0V5SJThydkzPi3DJdFEYw4Q9SNp55YiRqOrvTH08P8 eqjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DrBvDTc9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hq23si2854854ejc.89.2020.11.09.05.45.40; Mon, 09 Nov 2020 05:46:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=default header.b=DrBvDTc9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730294AbgKINAF (ORCPT + 99 others); Mon, 9 Nov 2020 08:00:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:54156 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730404AbgKINAA (ORCPT ); Mon, 9 Nov 2020 08:00:00 -0500 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 19DB7208FE; Mon, 9 Nov 2020 12:59:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604926799; bh=kbIQ2XAQlnIh6iAJjW3pWk5NnU8+kzBKiHepqLoqt9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DrBvDTc9nho29sq6sqHwkN5zc3NTExK+TWsB9Xb+aQfJ5vuguiv9W0XczYWJDoINp GNBCVC7mHibIlZJSjSd3hyOObV2F3OVHviR7RVAnKgDPNlPRsdVKoZmgnzFIza+N89 2zHZAI4sIik9G1fPhWnb9ZSpp2pS6M+kWx4VNyzg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, NeilBrown , Trond Myklebust , Calum Mackay Subject: [PATCH 4.9 001/117] SUNRPC: ECONNREFUSED should cause a rebind. Date: Mon, 9 Nov 2020 13:53:47 +0100 Message-Id: <20201109125025.700918529@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125025.630721781@linuxfoundation.org> References: <20201109125025.630721781@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: NeilBrown commit fd01b2597941d9c17980222999b0721648b383b8 upstream. If you - mount and NFSv3 filesystem - do some file locking which requires the server to make a GRANT call back - unmount - mount again and do the same locking then the second attempt at locking suffers a 30 second delay. Unmounting and remounting causes lockd to stop and restart, which causes it to bind to a new port. The server still thinks the old port is valid and gets ECONNREFUSED when trying to contact it. ECONNREFUSED should be seen as a hard error that is not worth retrying. Rebinding is the only reasonable response. This patch forces a rebind if that makes sense. Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust Cc: Calum Mackay Signed-off-by: Greg Kroah-Hartman --- net/sunrpc/clnt.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -1936,6 +1936,14 @@ call_connect_status(struct rpc_task *tas task->tk_status = 0; switch (status) { case -ECONNREFUSED: + /* A positive refusal suggests a rebind is needed. */ + if (RPC_IS_SOFTCONN(task)) + break; + if (clnt->cl_autobind) { + rpc_force_rebind(clnt); + task->tk_action = call_bind; + return; + } case -ECONNRESET: case -ECONNABORTED: case -ENETUNREACH: