Commit 4fcd1813e640 ("Fix reconnect to not defer smb3 session reconnect
long after socket reconnect") changes the behaviour of the SMB2 echo
service and causes it to renegotiate after a socket reconnect. However
under default settings, the echo service could take up to 120 seconds to
The patch forces the echo service to be called immediately resulting a
negotiate call being made immediately on reconnect.
Signed-off-by: Sachin Prabhu <[hidden email]>
Reviewed-by: Pavel Shilovsky <[hidden email]>
Signed-off-by: Steve French <[hidden email]>
(cherry picked from commit b8c600120fc87d53642476f48c8055b38d6e14c7)
Signed-off-by: Tim Gardner <[hidden email]>
fs/cifs/connect.c | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
@@ -423,17 +426,25 @@ cifs_echo_request(struct work_struct *work)
struct TCP_Server_Info *server = container_of(work,
struct TCP_Server_Info, echo.work);
- unsigned long echo_interval = server->echo_interval;
+ unsigned long echo_interval;
+ * If we need to renegotiate, set echo interval to zero to
+ * immediately call echo service where we can renegotiate.
+ if (server->tcpStatus == CifsNeedNegotiate)
+ echo_interval = 0;
+ echo_interval = server->echo_interval;
- * We cannot send an echo if it is disabled or until the
- * NEGOTIATE_PROTOCOL request is done, which is indicated by
- * server->ops->need_neg() == true. Also, no need to ping if
- * we got a response recently.
+ * We cannot send an echo if it is disabled.
+ * Also, no need to ping if we got a response recently.