summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorShyam Prasad N <sprasad@microsoft.com>2021-04-29 07:53:18 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-11 14:47:15 +0200
commit8a90058752e0b04b3159fa889a7f611b550bf816 (patch)
tree13d49f2fab182a89d64b588cf2f1d95753798c55 /fs/cifs
parent23d7b4a8f77ae1252ac1a0c496ec3b603f85f593 (diff)
downloadlinux-stable-8a90058752e0b04b3159fa889a7f611b550bf816.tar.gz
linux-stable-8a90058752e0b04b3159fa889a7f611b550bf816.tar.bz2
linux-stable-8a90058752e0b04b3159fa889a7f611b550bf816.zip
cifs: detect dead connections only when echoes are enabled.
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 <sprasad@microsoft.com> CC: <stable@vger.kernel.org> # v5.8+ Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/connect.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index fa359f473e3d..aabaebd1535f 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -663,6 +663,7 @@ server_unresponsive(struct TCP_Server_Info *server)
*/
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);