Skip to contentSkip to conversation

smb: client: fix dfs link mount against w2k8

PATCH In review Paulo Alcantara 2 participants 2 messages Aug 2, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smb: client: fix dfs link mount against w2k8

Customer reported that they couldn't mount their DFS link that was seen by the client as a DFS interlink -- special form of DFS link where its single target may point to a different DFS namespace -- and it turned out that it was just a regular DFS link where its referral header flags missed the StorageServers bit thus making the client think it couldn't tree connect to target directly without requiring further referrals.

When the DFS link referral header flags misses the StoraServers bit and its target doesn't respond to any referrals, then tree connect to it.

Fixes a1c0d00572fc ("cifs: share dfs connections and supers")
---
 fs/smb/client/dfs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
fs/smb/client/dfs.c +5 -1
index df3fd3b720da..ee772c3d9f00 100644
@@ -177,8 +177,12 @@ static int __dfs_mount_share(struct cifs_mount_ctx *mnt_ctx)
 		struct dfs_cache_tgt_list tl = DFS_CACHE_TGT_LIST_INIT(tl);
 
 		rc = dfs_get_referral(mnt_ctx, ref_path + 1, NULL, &tl);
-		if (rc)
+		if (rc) {
+			rc = cifs_mount_get_tcon(mnt_ctx);
+			if (!rc)
+				rc = cifs_is_path_remote(mnt_ctx);
 			break;
+		}
 
 		tit = dfs_cache_get_tgt_iterator(&tl);
 		if (!tit) {
Signature · 1 line
2.41.0
#1 lore raw

tentatively merged into cifs-2.6.git for-next pending testing

Quoted 40 lines · Paulo Alcantara

Customer reported that they couldn't mount their DFS link that was seen by the client as a DFS interlink -- special form of DFS link where its single target may point to a different DFS namespace -- and it turned out that it was just a regular DFS link where its referral header flags missed the StorageServers bit thus making the client think it couldn't tree connect to target directly without requiring further referrals.

When the DFS link referral header flags misses the StoraServers bit and its target doesn't respond to any referrals, then tree connect to it.

Fixes a1c0d00572fc ("cifs: share dfs connections and supers")
---
 fs/smb/client/dfs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
fs/smb/client/dfs.c +5 -2
index df3fd3b720da..ee772c3d9f00 100644
@@ -177,8 +177,12 @@ static int __dfs_mount_share(struct cifs_mount_ctx *mnt_ctx)
                struct dfs_cache_tgt_list tl = DFS_CACHE_TGT_LIST_INIT(tl);
 
                rc = dfs_get_referral(mnt_ctx, ref_path + 1, NULL, &tl);
-               if (rc)
+               if (rc) {
+                       rc = cifs_mount_get_tcon(mnt_ctx);
+                       if (!rc)
+                               rc = cifs_is_path_remote(mnt_ctx);
                        break;
+               }
 
                tit = dfs_cache_get_tgt_iterator(&tl);
                if (!tit) {
--

2.41.0

Signature · 3 lines
Thanks,

Steve