cifs: smbd: avoid reconnect lockup
authorLong Li <longli@microsoft.com>
Fri, 30 Mar 2018 22:16:35 +0000 (15:16 -0700)
committerSteve French <stfrench@microsoft.com>
Mon, 2 Apr 2018 01:24:40 +0000 (20:24 -0500)
commit48f238a79f668f8ff013024d83010de551833d7f
tree94ad861735b92bf1afca2979926d7eab30598387
parent2a18287b54f8654d9835cddfc80a12fd73162fc0
cifs: smbd: avoid reconnect lockup

During transport reconnect, other processes may have registered memory
and blocked on transport. This creates a deadlock situation because the
transport resources can't be freed, and reconnect is blocked.

Fix this by returning to upper layer on timeout. Before returning,
transport status is set to reconnecting so other processes will release
memory registration resources.

Upper layer will retry the reconnect. This is not in fast I/O path so
setting the timeout to 5 seconds.

Signed-off-by: Long Li <longli@microsoft.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
CC: Stable <stable@vger.kernel.org>
fs/cifs/smbdirect.c