|
@@ -155,7 +155,7 @@ out:
|
|
|
static int
|
|
|
smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
|
|
|
{
|
|
|
- int rc = 0;
|
|
|
+ int rc;
|
|
|
struct nls_table *nls_codepage;
|
|
|
struct cifs_ses *ses;
|
|
|
struct TCP_Server_Info *server;
|
|
@@ -166,10 +166,10 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
|
|
|
* for those three - in the calling routine.
|
|
|
*/
|
|
|
if (tcon == NULL)
|
|
|
- return rc;
|
|
|
+ return 0;
|
|
|
|
|
|
if (smb2_command == SMB2_TREE_CONNECT)
|
|
|
- return rc;
|
|
|
+ return 0;
|
|
|
|
|
|
if (tcon->tidStatus == CifsExiting) {
|
|
|
/*
|
|
@@ -212,8 +212,14 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
|
|
|
return -EAGAIN;
|
|
|
}
|
|
|
|
|
|
- wait_event_interruptible_timeout(server->response_q,
|
|
|
- (server->tcpStatus != CifsNeedReconnect), 10 * HZ);
|
|
|
+ rc = wait_event_interruptible_timeout(server->response_q,
|
|
|
+ (server->tcpStatus != CifsNeedReconnect),
|
|
|
+ 10 * HZ);
|
|
|
+ if (rc < 0) {
|
|
|
+ cifs_dbg(FYI, "%s: aborting reconnect due to a received"
|
|
|
+ " signal by the process\n", __func__);
|
|
|
+ return -ERESTARTSYS;
|
|
|
+ }
|
|
|
|
|
|
/* are we still trying to reconnect? */
|
|
|
if (server->tcpStatus != CifsNeedReconnect)
|
|
@@ -231,7 +237,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
|
|
|
}
|
|
|
|
|
|
if (!tcon->ses->need_reconnect && !tcon->need_reconnect)
|
|
|
- return rc;
|
|
|
+ return 0;
|
|
|
|
|
|
nls_codepage = load_nls_default();
|
|
|
|