Commit 77c2e45d authored by Paulo Alcantara's avatar Paulo Alcantara Committed by Steve French
Browse files

smb: client: don't trust DFSREF_STORAGE_SERVER bit



Some servers don't respect the DFSREF_STORAGE_SERVER bit, so
unconditionally tree connect to DFS link target and then decide
whether or not continue chasing DFS referrals for DFS interlinks.
Otherwise the client would fail to mount such shares.

Signed-off-by: default avatarPaulo Alcantara (Red Hat) <pc@manguebit.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 2014c95a
Loading
Loading
Loading
Loading
+16 −14
Original line number Diff line number Diff line
@@ -150,18 +150,19 @@ static int __dfs_referral_walk(struct dfs_ref_walk *rw)
			if (rc)
				continue;

			if (tgt.flags & DFSREF_STORAGE_SERVER) {
			rc = cifs_mount_get_tcon(mnt_ctx);
				if (!rc)
			if (rc) {
				if (tgt.server_type == DFS_TYPE_LINK &&
				    DFS_INTERLINK(tgt.flags))
					rc = -EREMOTE;
			} else {
				rc = cifs_is_path_remote(mnt_ctx);
				if (!rc) {
					ref_walk_set_tgt_hint(rw);
					break;
				}
				if (rc != -EREMOTE)
					continue;
			}

			if (rc == -EREMOTE) {
				rc = ref_walk_advance(rw);
				if (!rc) {
					rc = setup_dfs_ref(&tgt, rw);
@@ -171,6 +172,7 @@ static int __dfs_referral_walk(struct dfs_ref_walk *rw)
					goto again;
				}
			}
		}
	} while (rc && ref_walk_descend(rw));

	free_dfs_info_param(&tgt);