Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2472321pxj; Mon, 10 May 2021 03:57:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWXLvfr2f3O6rprZtLEGaW+8AwNbshgBM+4Q7veVUITQ+hk7Yr1hNfcWhevzIm6NwlLTvg X-Received: by 2002:a05:6e02:156c:: with SMTP id k12mr20707828ilu.49.1620644234015; Mon, 10 May 2021 03:57:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620644234; cv=none; d=google.com; s=arc-20160816; b=IKuZWN1pIJr8ADGMy+ubEbco7IVxEKsY5gv4rpOd8oDtvatgeb9OTK5PqZ2Lg9qeXM bF2rdaQti0k0dABmqhNtUXGYhEdL4RwJjX6C2OZQSPrwy/uu1n38LQhg+jIjKpGjhnqK usgbiS+RaT9xVdLglfN9NwH9whTqSb0lcDxoTa+qRt5Im/paIMIDF7FBcs8hoPQKqYt6 vYKDl1iw1NlNpSKMlOVrn8e5l1YgNauucjSbD6WzvqNu+vLMYgMY02Y21A/oSuoBHCPe jbg/4lNIREx/MMGuGQpZ48nXhWpEReFkuFk6ryADYuPR9bH4v0tsFMxCgsrvxPyclqp7 DZqQ== 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=sVCgeYGO3Z1KVi4gCL8HrrWHZF7HTDNswkctqbweA3w=; b=dDZvs3DYzbVoBU7JQyhE3hcq3ooa+/lJbE6kr3pXEaErI8oV7OKSMi7weCf1VeqRxP Vrbj3Vsm+0K9/YIzsHv89MuEotxDXVUQKTq0UUSX6LtytbEKQ1rOp+iQaFt4yLx0w3DY mPv3cYWnVV9HISzFxKhJF2QJkQ4h7w1vLKcZTpkp3fYiQu56OCy/rozYPV82A8O6ouJJ 7QyBGT6BQPZ8oigEqhg8PZqdpAfmG0ScjrzHyVL54lYcurKiFxh+qMUOub0Nz9yXvEFb vSyTl9h0BNPGkaUQzQ11OxXGtgaWc7Wl5QGBXExiIZFs6CMqH9EQZ2h99I23CNNbYUq7 zBJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=A6t9WFH7; 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=pass (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 c71si16473489jai.86.2021.05.10.03.57.01; Mon, 10 May 2021 03:57:14 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=A6t9WFH7; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232970AbhEJKyL (ORCPT + 99 others); Mon, 10 May 2021 06:54:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:50390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232158AbhEJKmw (ORCPT ); Mon, 10 May 2021 06:42:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C272F61936; Mon, 10 May 2021 10:32:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642766; bh=jEWp1Ei+9CWUsh0MN6h7rqcu3PILQeAqxFsp12LO8rk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A6t9WFH7/+WH9tXMigvehC7RJbPPLpuujn4P00hziZxVY35As0Gu7A9iHHRHmd4Sn lQCSEwgsR7VAH08AKW6P4x2zQtgSeMZYyM4zhIufTQmP9IRNF6KkK6Xj2En4qklL/u EBc7XDJcwI2j881XqloL380VdSNA59C1791dn044= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shyam Prasad N , Steve French Subject: [PATCH 5.10 041/299] cifs: detect dead connections only when echoes are enabled. Date: Mon, 10 May 2021 12:17:18 +0200 Message-Id: <20210510102006.210971867@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 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: Shyam Prasad N commit f4916649f98e2c7bdba38c6597a98c456c17317d upstream. We can detect server unresponsiveness only if echoes are enabled. Echoes can be disabled under two scenarios: 1. The connection is low on credits, so we've disabled echoes/oplocks. 2. The connection has not seen any request till now (other than negotiate/sess-setup), which is when we enable these two, based on the credits available. So this fix will check for dead connection, only when echo is enabled. Signed-off-by: Shyam Prasad N CC: # v5.8+ Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/cifs/connect.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -663,6 +663,7 @@ server_unresponsive(struct TCP_Server_In */ if ((server->tcpStatus == CifsGood || server->tcpStatus == CifsNeedNegotiate) && + (!server->ops->can_echo || server->ops->can_echo(server)) && time_after(jiffies, server->lstrp + 3 * server->echo_interval)) { cifs_server_dbg(VFS, "has not responded in %lu seconds. Reconnecting...\n", (3 * server->echo_interval) / HZ);