From patchwork Wed Apr 6 14:26:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Finney X-Patchwork-Id: 689921 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p36ERAwg015203 for ; Wed, 6 Apr 2011 14:27:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755963Ab1DFO1K (ORCPT ); Wed, 6 Apr 2011 10:27:10 -0400 Received: from seldrel01.sonyericsson.com ([212.209.106.2]:13018 "EHLO seldrel01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755952Ab1DFO1J (ORCPT ); Wed, 6 Apr 2011 10:27:09 -0400 From: Sean Finney To: linux-cifs@vger.kernel.org CC: Sean Finney Subject: [PATCH v4 2/6] cifs: Add support for mounting Windows 2008 DFS shares Date: Wed, 6 Apr 2011 16:26:41 +0200 Message-ID: <1302100005-1848-2-git-send-email-seanius@seanius.net> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1302100005-1848-1-git-send-email-seanius@seanius.net> References: <1302100005-1848-1-git-send-email-seanius@seanius.net> MIME-Version: 1.0 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 06 Apr 2011 14:27:11 +0000 (UTC) Windows 2008 CIFS servers do not always return PATH_NOT_COVERED when attempting to access a DFS share. Therefore, when checking for remote shares, unconditionally ask for a DFS referral for the UNC (w/out prepath) before continuing with previous behavior of attempting to access the UNC + prepath and checking for PATH_NOT_COVERED. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=31092 Signed-off-by: Sean Finney Reviewed-by: Jeff Layton --- fs/cifs/connect.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index c89d871..4873bac 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 */