Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2495424pxj; Mon, 10 May 2021 04:30:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhC4ncuwcNtbsnaRVCZE71nCDYEMvZj+gFvuuNdnyUl7BewrCy25GPxCUmJUmDK8Fi0YmM X-Received: by 2002:a02:c912:: with SMTP id t18mr20849504jao.100.1620646208992; Mon, 10 May 2021 04:30:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620646208; cv=none; d=google.com; s=arc-20160816; b=Up2WhWtfFOHgTV+JkyssWseLj8UD0GDK/yhdAHv+HHdr5nZpe91vK+JfvRgpr/4AMc Y7v0Rk0U/o2mqBxgjgWAnXgdZKn08h2whMxJQ8uhIQH/X3uuMpTCwJ2Qop3n1HpUn4B9 ae8HdHcYTU9OPDJiYojLEFw2adeStjhD/Hq0bAWdGn9DtBl5hkZ7JgFnniFwvkh9feMP W/QP7yw7AYU0wL+IfXq+8LX9NVbcQPxdVkRrpeXJ6HPkM2M/BlcfR69INsBxCgxB2ucx HShsZcXhLb+jY/ZXU0CTaml75clAEfPdNSFvYIe3Psmm1kPiKPb0yKm2Wt3+xaOsXpo9 lbMQ== 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=FQk9glB5vosJaX+4zf7Pf9wAS9aZpsIg0N0jqdM7+Fw=; b=jT/IhiUmLROld9JUNigBzgOKGTU3Pq2LyDvXbMnoBcppsxsuSXXtHk9znzosvTeg38 FfSM2FCwbvX4Hh78m9LLCpDk71SJy9l3ZnUHj/XV6cVPoB4SfLVQnmX5hT6pqCJBpUuh gux9RLZrvYwHztCBMJxEKmQjuie7Mnr3P/3zAqeCjpD2tiQufaHfjS9SQd6xp1JkwTzm K4VVb3wx9qCCAAKzxWgpS7AIGqJIQfWCW4/fQUQ7ZVXsTZ4k0wQpxTjWsZOwyYyMCdsd OntTZ6bF5+SOjx4Hg5zdksYtMgV+sLKyqmYEJ9HGS82RMJGn0EoDAMFFShZD5lc+g7Y7 UjTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="QS/kRxv2"; 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 y13si13099902ilu.37.2021.05.10.04.29.55; Mon, 10 May 2021 04:30:08 -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="QS/kRxv2"; 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 S239276AbhEJL0O (ORCPT + 99 others); Mon, 10 May 2021 07:26:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:53004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234379AbhEJK4T (ORCPT ); Mon, 10 May 2021 06:56:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7EC81619A4; Mon, 10 May 2021 10:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643534; bh=1YN+s86/A3wBK8DclWLxTTZe/V+2+wWyeumguiQT+L0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QS/kRxv2z0BnkQlm8Q5+1sAyVCtvBdjxw1EYIu4k0xmTqaplYrCe8wTMtAhGGUw64 4ynBR1AvR0x5tKm4Y+/QZTIjvAnpIeeyd76iJzoK4bDmELAC6fiAS8zq3e4KyaKi8K 6jAqaW9+KPOwTDll5rGfc4yvTg+G64f+zhAbsFjY= 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.11 052/342] cifs: detect dead connections only when echoes are enabled. Date: Mon, 10 May 2021 12:17:22 +0200 Message-Id: <20210510102011.845024708@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102010.096403571@linuxfoundation.org> References: <20210510102010.096403571@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 @@ -488,6 +488,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);