diff options
Diffstat (limited to 'fs/cifs/cifssmb.c')
| -rw-r--r-- | fs/cifs/cifssmb.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 7f0651b69573..cd9e9a145e4d 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
| @@ -664,8 +664,9 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
| 664 | rc = -EIO; | 664 | rc = -EIO; |
| 665 | goto neg_err_exit; | 665 | goto neg_err_exit; |
| 666 | } | 666 | } |
| 667 | 667 | read_lock(&cifs_tcp_ses_lock); | |
| 668 | if (server->socketUseCount.counter > 1) { | 668 | if (server->srv_count > 1) { |
| 669 | read_unlock(&cifs_tcp_ses_lock); | ||
| 669 | if (memcmp(server->server_GUID, | 670 | if (memcmp(server->server_GUID, |
| 670 | pSMBr->u.extended_response. | 671 | pSMBr->u.extended_response. |
| 671 | GUID, 16) != 0) { | 672 | GUID, 16) != 0) { |
| @@ -674,9 +675,11 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
| 674 | pSMBr->u.extended_response.GUID, | 675 | pSMBr->u.extended_response.GUID, |
| 675 | 16); | 676 | 16); |
| 676 | } | 677 | } |
| 677 | } else | 678 | } else { |
| 679 | read_unlock(&cifs_tcp_ses_lock); | ||
| 678 | memcpy(server->server_GUID, | 680 | memcpy(server->server_GUID, |
| 679 | pSMBr->u.extended_response.GUID, 16); | 681 | pSMBr->u.extended_response.GUID, 16); |
| 682 | } | ||
| 680 | 683 | ||
| 681 | if (count == 16) { | 684 | if (count == 16) { |
| 682 | server->secType = RawNTLMSSP; | 685 | server->secType = RawNTLMSSP; |
| @@ -830,12 +833,9 @@ CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses) | |||
| 830 | pSMB->AndXCommand = 0xFF; | 833 | pSMB->AndXCommand = 0xFF; |
| 831 | rc = SendReceiveNoRsp(xid, ses, (struct smb_hdr *) pSMB, 0); | 834 | rc = SendReceiveNoRsp(xid, ses, (struct smb_hdr *) pSMB, 0); |
| 832 | session_already_dead: | 835 | session_already_dead: |
| 833 | atomic_dec(&ses->server->socketUseCount); | 836 | if (ses->server) { |
| 834 | if (atomic_read(&ses->server->socketUseCount) == 0) { | 837 | cifs_put_tcp_session(ses->server); |
| 835 | spin_lock(&GlobalMid_Lock); | 838 | rc = 0; |
| 836 | ses->server->tcpStatus = CifsExiting; | ||
| 837 | spin_unlock(&GlobalMid_Lock); | ||
| 838 | rc = -ESHUTDOWN; | ||
| 839 | } | 839 | } |
| 840 | up(&ses->sesSem); | 840 | up(&ses->sesSem); |
| 841 | 841 | ||
