Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[linux-2.6-block.git] / fs / cifs / connect.c
index 52d71b64c0c6e5f954d408098fc78197898399c7..d82f0cc7175508e9881873a2ee9c8a53c1a72944 100644 (file)
@@ -250,6 +250,7 @@ static const match_table_t cifs_mount_option_tokens = {
        { Opt_ignore, "dev" },
        { Opt_ignore, "mand" },
        { Opt_ignore, "nomand" },
+       { Opt_ignore, "relatime" },
        { Opt_ignore, "_netdev" },
 
        { Opt_err, NULL }
@@ -347,7 +348,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
        server->maxBuf = 0;
        server->max_read = 0;
 
-       cifs_dbg(FYI, "Reconnecting tcp session\n");
+       cifs_dbg(FYI, "Mark tcp session as need reconnect\n");
        trace_smb3_reconnect(server->CurrentMid, server->hostname);
 
        /* before reconnecting the tcp session, mark the smb session (uid)
@@ -2396,6 +2397,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
                volume_info->target_rfc1001_name, RFC1001_NAME_LEN_WITH_NULL);
        tcp_ses->session_estab = false;
        tcp_ses->sequence_number = 0;
+       tcp_ses->reconnect_instance = 0;
        tcp_ses->lstrp = jiffies;
        spin_lock_init(&tcp_ses->req_lock);
        INIT_LIST_HEAD(&tcp_ses->tcp_ses_list);
@@ -3085,10 +3087,6 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info)
        if (rc)
                goto out_fail;
 
-       if (volume_info->nodfs) {
-               tcon->Flags &= ~SMB_SHARE_IS_IN_DFS;
-               cifs_dbg(FYI, "DFS disabled (%d)\n", tcon->Flags);
-       }
        tcon->use_persistent = false;
        /* check if SMB2 or later, CIFS does not support persistent handles */
        if (volume_info->persistent) {
@@ -3663,6 +3661,8 @@ int cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
        cifs_sb->actimeo = pvolume_info->actimeo;
        cifs_sb->local_nls = pvolume_info->local_nls;
 
+       if (pvolume_info->nodfs)
+               cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_DFS;
        if (pvolume_info->noperm)
                cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_PERM;
        if (pvolume_info->setuids)
@@ -3819,6 +3819,9 @@ expand_dfs_referral(const unsigned int xid, struct cifs_ses *ses,
        struct dfs_info3_param *referrals = NULL;
        char *full_path = NULL, *ref_path = NULL, *mdata = NULL;
 
+       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_DFS)
+               return -EREMOTE;
+
        full_path = build_unc_path_to_root(volume_info, cifs_sb);
        if (IS_ERR(full_path))
                return PTR_ERR(full_path);