aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorAurelien Aptel <aaptel@suse.com>2018-09-20 18:10:25 -0700
committerSteve French <stfrench@microsoft.com>2018-10-23 21:16:05 -0500
commit8393072bab060f0a05888ee31543175d44b5dde0 (patch)
treecfc22288674c170a1699b78fa752baaa82071aa4 /fs/cifs/connect.c
parentsmb3: track the instance of each session for debugging (diff)
downloadlinux-dev-8393072bab060f0a05888ee31543175d44b5dde0.tar.xz
linux-dev-8393072bab060f0a05888ee31543175d44b5dde0.zip
CIFS: make 'nodfs' mount opt a superblock flag
tcon->Flags is only used by SMB1 code and changing it is not permanent (you lose the setting on tcon reconnect). * Move the setting to superblock flags (per mount-points). * Make automount callback exit early when flag present * Make dfs resolving happening in mount syscall exit early if flag present Signed-off-by: Aurelien Aptel <aaptel@suse.com> Signed-off-by: Steve French <stfrench@microsoft.com> Acked-by: Pavel Shilovsky <pshilov@microsoft.com>
Diffstat (limited to '')
-rw-r--r--fs/cifs/connect.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 106d3a85f77b..6221aef45ff5 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3086,10 +3086,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) {
@@ -3664,6 +3660,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)
@@ -3820,6 +3818,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);