From patchwork Fri Apr 1 11:53:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Finney X-Patchwork-Id: 681001 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 p31CRJin031907 for ; Fri, 1 Apr 2011 12:27:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754251Ab1DAM1T (ORCPT ); Fri, 1 Apr 2011 08:27:19 -0400 Received: from seldrel01.sonyericsson.com ([212.209.106.2]:14822 "EHLO seldrel01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753159Ab1DAM1S (ORCPT ); Fri, 1 Apr 2011 08:27:18 -0400 Message-ID: In-Reply-To: <20110401073256.70180710@tlielax.poochiereds.net> References: <20110401073256.70180710@tlielax.poochiereds.net> From: Sean Finney Date: Fri, 1 Apr 2011 13:53:02 +0200 Subject: [PATCH 2/4] Fix Bug#31092: Unable to mount DFS filesystems from Windows 2008 servers To: linux-cifs@vger.kernel.org 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]); Fri, 01 Apr 2011 12:27:20 +0000 (UTC) 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 */