smb: client: relax session and tcon reconnect attempts
authorPaulo Alcantara <pc@manguebit.org>
Thu, 4 Dec 2025 18:06:23 +0000 (15:06 -0300)
committerSteve French <stfrench@microsoft.com>
Fri, 5 Dec 2025 23:40:33 +0000 (17:40 -0600)
commit855982a52ff7d188188f0ecf86c2ce95957202c6
tree62e0171cb5c5892abee05edfcb42eff211df3408
parent4ae4dde6f34a4124c65468ae4fa1f915fb40f900
smb: client: relax session and tcon reconnect attempts

When the client re-establishes connection to the server, it will queue
a worker thread that will attempt to reconnect sessions and tcons on
every two seconds, which is kinda overkill as it is a very common
scenario when having expired passwords or KRB5 TGT tickets, or deleted
shares.

Use an exponential backoff strategy to handle session/tcon reconnect
attempts in the worker thread to prevent the client from overloading
the system when it is very unlikely to re-establish any session/tcon
soon while client is idle.

Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Reviewed-by: David Howells <dhowells@redhat.com>
Cc: Pierguido Lambri <plambri@redhat.com>
Cc: linux-cifs@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifsglob.h
fs/smb/client/connect.c
fs/smb/client/smb2pdu.c