diff mbox

[2/4] Fix Bug#31092: Unable to mount DFS filesystems from Windows 2008 servers

Message ID E1Q5dRc-0005jb-QI@seldlx2151.corpusers.net (mailing list archive)
State New, archived
Headers show

Commit Message

Sean Finney April 1, 2011, 11:53 a.m. UTC
None
diff mbox

Patch

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 7a9b2da..9425c7b 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2934,6 +2934,24 @@  try_mount_again:
 			       (tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE));
 
 remote_path_check:
+#ifdef CONFIG_CIFS_DFS_UPCALL
+	/*
+	 * Perform an unconditional check for whether there are DFS
+	 * referrals for this path without prefix, to provide support
+	 * for DFS referrals from w2k8 servers which don't seem to respond
+	 * with PATH_NOT_COVERED to requests that include the prefix.
+	 * Chase the referral if found, otherwise continue normally.
+	 */
+	if (referral_walks_count == 0) {
+		int refrc = expand_dfs_referral(xid, pSesInfo, volume_info,
+						cifs_sb, &mount_data, false);
+		if (!refrc) {
+			referral_walks_count++;
+			goto try_mount_again;
+		}
+	}
+#endif
+
 	/* check if a whole path (including prepath) is not remote */
 	if (!rc && tcon) {
 		/* build_path_to_root works only when we have a valid tcon */