diff options
Diffstat (limited to 'fs/cifs/cifssmb.c')
| -rw-r--r-- | fs/cifs/cifssmb.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 48455afefec8..7cbe28315971 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
| @@ -178,6 +178,18 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command) | |||
| 178 | * reconnect the same SMB session | 178 | * reconnect the same SMB session |
| 179 | */ | 179 | */ |
| 180 | mutex_lock(&ses->session_mutex); | 180 | mutex_lock(&ses->session_mutex); |
| 181 | |||
| 182 | /* | ||
| 183 | * Recheck after acquire mutex. If another thread is negotiating | ||
| 184 | * and the server never sends an answer the socket will be closed | ||
| 185 | * and tcpStatus set to reconnect. | ||
| 186 | */ | ||
| 187 | if (server->tcpStatus == CifsNeedReconnect) { | ||
| 188 | rc = -EHOSTDOWN; | ||
| 189 | mutex_unlock(&ses->session_mutex); | ||
| 190 | goto out; | ||
| 191 | } | ||
| 192 | |||
| 181 | rc = cifs_negotiate_protocol(0, ses); | 193 | rc = cifs_negotiate_protocol(0, ses); |
| 182 | if (rc == 0 && ses->need_reconnect) | 194 | if (rc == 0 && ses->need_reconnect) |
| 183 | rc = cifs_setup_session(0, ses, nls_codepage); | 195 | rc = cifs_setup_session(0, ses, nls_codepage); |
