diff options
author | Shirish Pargaonkar <shirishpargaonkar@gmail.com> | 2013-10-03 12:44:45 +0200 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2013-10-07 03:18:42 +0200 |
commit | eb4c7df6c20b407ecbf1a985edc33d967371c2e8 (patch) | |
tree | 09e3117fabaa3ec8f95f3e70a747f5e0f9990ada /fs/cifs/transport.c | |
parent | do not treat non-symlink reparse points as valid symlinks (diff) | |
download | linux-eb4c7df6c20b407ecbf1a985edc33d967371c2e8.tar.xz linux-eb4c7df6c20b407ecbf1a985edc33d967371c2e8.zip |
cifs: Avoid umount hangs with smb2 when server is unresponsive
Do not send SMB2 Logoff command when reconnecting, the way smb1
code base works.
Also, no need to wait for a credit for an echo command when one is already
in flight.
Without these changes, umount command hangs if the server is unresponsive
e.g. hibernating.
Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r-- | fs/cifs/transport.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 6fdcb1b4a106..800b938e4061 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -410,8 +410,13 @@ static int wait_for_free_request(struct TCP_Server_Info *server, const int timeout, const int optype) { - return wait_for_free_credits(server, timeout, - server->ops->get_credits_field(server, optype)); + int *val; + + val = server->ops->get_credits_field(server, optype); + /* Since an echo is already inflight, no need to wait to send another */ + if (*val <= 0 && optype == CIFS_ECHO_OP) + return -EAGAIN; + return wait_for_free_credits(server, timeout, val); } static int allocate_mid(struct cifs_ses *ses, struct smb_hdr *in_buf, |