Skip to content

Commit f491664

Browse files
sprasad-microsoftsmfrench
authored andcommitted
cifs: detect dead connections only when echoes are enabled.
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>
1 parent 7ba3d1c commit f491664

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/cifs/connect.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ server_unresponsive(struct TCP_Server_Info *server)
476476
*/
477477
if ((server->tcpStatus == CifsGood ||
478478
server->tcpStatus == CifsNeedNegotiate) &&
479+
(!server->ops->can_echo || server->ops->can_echo(server)) &&
479480
time_after(jiffies, server->lstrp + 3 * server->echo_interval)) {
480481
cifs_server_dbg(VFS, "has not responded in %lu seconds. Reconnecting...\n",
481482
(3 * server->echo_interval) / HZ);

0 commit comments

Comments
 (0)