|
@@ -562,8 +562,10 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
|
|
|
* but for time being this is our only auth choice so doesn't matter.
|
|
|
* We just found a server which sets blob length to zero expecting raw.
|
|
|
*/
|
|
|
- if (blob_length == 0)
|
|
|
+ if (blob_length == 0) {
|
|
|
cifs_dbg(FYI, "missing security blob on negprot\n");
|
|
|
+ server->sec_ntlmssp = true;
|
|
|
+ }
|
|
|
|
|
|
rc = cifs_enable_signing(server, ses->sign);
|
|
|
if (rc)
|
|
@@ -1171,9 +1173,6 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
|
|
|
else
|
|
|
return -EIO;
|
|
|
|
|
|
- if (tcon && tcon->bad_network_name)
|
|
|
- return -ENOENT;
|
|
|
-
|
|
|
unc_path = kmalloc(MAX_SHARENAME_LENGTH * 2, GFP_KERNEL);
|
|
|
if (unc_path == NULL)
|
|
|
return -ENOMEM;
|
|
@@ -1277,8 +1276,6 @@ tcon_exit:
|
|
|
tcon_error_exit:
|
|
|
if (rsp->hdr.sync_hdr.Status == STATUS_BAD_NETWORK_NAME) {
|
|
|
cifs_dbg(VFS, "BAD_NETWORK_NAME: %s\n", tree);
|
|
|
- if (tcon)
|
|
|
- tcon->bad_network_name = true;
|
|
|
}
|
|
|
goto tcon_exit;
|
|
|
}
|
|
@@ -2181,6 +2178,9 @@ void smb2_reconnect_server(struct work_struct *work)
|
|
|
struct cifs_tcon *tcon, *tcon2;
|
|
|
struct list_head tmp_list;
|
|
|
int tcon_exist = false;
|
|
|
+ int rc;
|
|
|
+ int resched = false;
|
|
|
+
|
|
|
|
|
|
/* Prevent simultaneous reconnects that can corrupt tcon->rlist list */
|
|
|
mutex_lock(&server->reconnect_mutex);
|
|
@@ -2208,13 +2208,18 @@ void smb2_reconnect_server(struct work_struct *work)
|
|
|
spin_unlock(&cifs_tcp_ses_lock);
|
|
|
|
|
|
list_for_each_entry_safe(tcon, tcon2, &tmp_list, rlist) {
|
|
|
- if (!smb2_reconnect(SMB2_INTERNAL_CMD, tcon))
|
|
|
+ rc = smb2_reconnect(SMB2_INTERNAL_CMD, tcon);
|
|
|
+ if (!rc)
|
|
|
cifs_reopen_persistent_handles(tcon);
|
|
|
+ else
|
|
|
+ resched = true;
|
|
|
list_del_init(&tcon->rlist);
|
|
|
cifs_put_tcon(tcon);
|
|
|
}
|
|
|
|
|
|
cifs_dbg(FYI, "Reconnecting tcons finished\n");
|
|
|
+ if (resched)
|
|
|
+ queue_delayed_work(cifsiod_wq, &server->reconnect, 2 * HZ);
|
|
|
mutex_unlock(&server->reconnect_mutex);
|
|
|
|
|
|
/* now we can safely release srv struct */
|