Fix reconnect to not defer smb3 session reconnect long after socket reconnect
authorSteve French <smfrench@gmail.com>
Thu, 23 Jun 2016 01:12:05 +0000 (20:12 -0500)
committerWilly Tarreau <w@1wt.eu>
Sat, 27 Aug 2016 09:40:29 +0000 (11:40 +0200)
commit655e0c067f0e02ece03fd0591dabe3db2ae27552
tree3e76f8a61e1fa02fcba187ef9ac0324742452f38
parent75b319d68655ff8790f9c03f294c31d81de3b08c
Fix reconnect to not defer smb3 session reconnect long after socket reconnect

commit 4fcd1813e6404dd4420c7d12fb483f9320f0bf93 upstream.

Azure server blocks clients that open a socket and don't do anything on it.
In our reconnect scenarios, we can reconnect the tcp session and
detect the socket is available but we defer the negprot and SMB3 session
setup and tree connect reconnection until the next i/o is requested, but
this looks suspicous to some servers who expect SMB3 negprog and session
setup soon after a socket is created.

In the echo thread, reconnect SMB3 sessions and tree connections
that are disconnected.  A later patch will replay persistent (and
resilient) handle opens.

Signed-off-by: Steve French <steve.french@primarydata.com>
Acked-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
fs/cifs/connect.c
fs/cifs/smb2pdu.c