aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/smb2transport.c')
-rw-r--r--fs/cifs/smb2transport.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c
index 340abca3aa52..59c748ce872f 100644
--- a/fs/cifs/smb2transport.c
+++ b/fs/cifs/smb2transport.c
@@ -466,7 +466,7 @@ smb2_verify_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
466static inline void 466static inline void
467smb2_seq_num_into_buf(struct TCP_Server_Info *server, struct smb2_hdr *hdr) 467smb2_seq_num_into_buf(struct TCP_Server_Info *server, struct smb2_hdr *hdr)
468{ 468{
469 hdr->MessageId = get_next_mid(server); 469 hdr->MessageId = get_next_mid64(server);
470} 470}
471 471
472static struct mid_q_entry * 472static struct mid_q_entry *
@@ -516,13 +516,19 @@ smb2_get_mid_entry(struct cifs_ses *ses, struct smb2_hdr *buf,
516 return -EAGAIN; 516 return -EAGAIN;
517 } 517 }
518 518
519 if (ses->status != CifsGood) { 519 if (ses->status == CifsNew) {
520 /* check if SMB2 session is bad because we are setting it up */
521 if ((buf->Command != SMB2_SESSION_SETUP) && 520 if ((buf->Command != SMB2_SESSION_SETUP) &&
522 (buf->Command != SMB2_NEGOTIATE)) 521 (buf->Command != SMB2_NEGOTIATE))
523 return -EAGAIN; 522 return -EAGAIN;
524 /* else ok - we are setting up session */ 523 /* else ok - we are setting up session */
525 } 524 }
525
526 if (ses->status == CifsExiting) {
527 if (buf->Command != SMB2_LOGOFF)
528 return -EAGAIN;
529 /* else ok - we are shutting down the session */
530 }
531
526 *mid = smb2_mid_entry_alloc(buf, ses->server); 532 *mid = smb2_mid_entry_alloc(buf, ses->server);
527 if (*mid == NULL) 533 if (*mid == NULL)
528 return -ENOMEM; 534 return -ENOMEM;