diff options
author | Shirish Pargaonkar <shirishpargaonkar@gmail.com> | 2013-10-12 10:06:03 -0500 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2015-09-02 11:52:09 +0200 |
commit | a67172a013953664b1dad03c648200c70b90506c (patch) | |
tree | 878fa302580d22ac28c186effa17c4a26e38a026 /fs/cifs/transport.c | |
parent | 6f767a3106227c491d3b27c43887b92c0f9287f8 (diff) |
cifs: Send a logoff request before removing a smb session
commit 7f48558e6489d032b1584b0cc9ac4bb11072c034 upstream.
Send a smb session logoff request before removing smb session off of the list.
On a signed smb session, remvoing a session off of the list before sending
a logoff request results in server returning an error for lack of
smb signature.
Never seen an error during smb logoff, so as per MS-SMB2 3.2.5.1,
not sure how an error during logoff should be retried. So for now,
if a server returns an error to a logoff request, log the error and
remove the session off of the list.
Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r-- | fs/cifs/transport.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 800b938e4061..ebb46e311e0b 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -431,13 +431,20 @@ static int allocate_mid(struct cifs_ses *ses, struct smb_hdr *in_buf, return -EAGAIN; } - if (ses->status != CifsGood) { - /* check if SMB session is bad because we are setting it up */ + if (ses->status == CifsNew) { if ((in_buf->Command != SMB_COM_SESSION_SETUP_ANDX) && (in_buf->Command != SMB_COM_NEGOTIATE)) return -EAGAIN; /* else ok - we are setting up session */ } + + if (ses->status == CifsExiting) { + /* check if SMB session is bad because we are setting it up */ + if (in_buf->Command != SMB_COM_LOGOFF_ANDX) + return -EAGAIN; + /* else ok - we are shutting down session */ + } + *ppmidQ = AllocMidQEntry(in_buf, ses->server); if (*ppmidQ == NULL) return -ENOMEM; |