From mboxrd@z Thu Jan 1 00:00:00 1970 From: Igor Mammedov Subject: Re: DFS patch series - fixed Date: Sat, 26 Apr 2008 21:41:25 +0400 Message-ID: <48136945.5020004@gmail.com> References: <524f69650804251734y48a1ccf8g899b4bc3a5a21262@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050407010007040401010903" Cc: "Q (Igor Mammedov)" , Jeremy Allison , linux-fsdevel To: Steve French Return-path: Received: from fg-out-1718.google.com ([72.14.220.152]:51050 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751673AbYDZRlb (ORCPT ); Sat, 26 Apr 2008 13:41:31 -0400 Received: by fg-out-1718.google.com with SMTP id l27so4136233fgb.17 for ; Sat, 26 Apr 2008 10:41:30 -0700 (PDT) In-Reply-To: <524f69650804251734y48a1ccf8g899b4bc3a5a21262@mail.gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: This is a multi-part message in MIME format. --------------050407010007040401010903 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Steve French wrote: > I merged the first patch in your remaining cifs dfs series patch > 0001-Adds-to-dns_resolver-checking-if-the-server-name-is.patch into > the cifs tree, but isn't this section of the 2nd patch of three ie > 0002-fixed-compatibility-issue-with-samba-a-refferal-req.patch > incorrect? It is converting the slashes in the whole path (not in the > UNC prefix) - so escape sequences in real posix directory and file > names will be converted to separators. This seems wrong. We should > be converting just the treename part here. > > ... Fixed, now it converts only treeName part of the path: 0003-fixed-compatibility-issue-with-samba-a-refferal-requ.patch In my test setup it works. -- Best regards, ------------------------- Igor Mammedov, niallain "at" gmail.com --------------050407010007040401010903 Content-Type: text/x-patch; name="0003-fixed-compatibility-issue-with-samba-a-refferal-requ.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0003-fixed-compatibility-issue-with-samba-a-refferal-requ.pa"; filename*1="tch" >>From 29f7313c1e594b5c2c9ff0e0672d551c23354c7d Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Sat, 26 Apr 2008 21:20:28 +0400 Subject: [PATCH] fixed compatibility issue with samba:a refferal request treeName part is canonized to '/' path separator Signed-off-by: Igor Mammedov --- fs/cifs/cifs_dfs_ref.c | 25 ++++++++++++++----------- 1 files changed, 14 insertions(+), 11 deletions(-) diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c index f53f41f..e0a3a56 100644 --- a/fs/cifs/cifs_dfs_ref.c +++ b/fs/cifs/cifs_dfs_ref.c @@ -81,15 +81,11 @@ static char *cifs_get_share_name(const char *node_name) /* find sharename end */ pSep++; pSep = memchr(UNC+(pSep-UNC), '\\', len-(pSep-UNC)); - if (!pSep) { - cERROR(1, ("%s:2 cant find share name in node name: %s", - __func__, node_name)); - kfree(UNC); - return NULL; + if (pSep) { + /* trim path up to sharename end + * now we have share name in UNC */ + *pSep = 0; } - /* trim path up to sharename end - * * now we have share name in UNC */ - *pSep = 0; return UNC; } @@ -176,7 +172,7 @@ static char *compose_mount_options(const char *sb_mountdata, tkn_e = strchr(tkn_e+1, '\\'); if (tkn_e) { strcat(mountdata, ",prefixpath="); - strcat(mountdata, tkn_e); + strcat(mountdata, tkn_e+1); } } @@ -232,7 +228,8 @@ static char *build_full_dfs_path_from_dentry(struct dentry *dentry) return NULL; if (cifs_sb->tcon->Flags & SMB_SHARE_IS_IN_DFS) { - /* we should use full path name to correct working with DFS */ + int i; + /* we should use full path name for correct working with DFS */ l_max_len = strnlen(cifs_sb->tcon->treeName, MAX_TREE_SIZE+1) + strnlen(search_path, MAX_PATHCONF) + 1; tmp_path = kmalloc(l_max_len, GFP_KERNEL); @@ -241,8 +238,14 @@ static char *build_full_dfs_path_from_dentry(struct dentry *dentry) return NULL; } strncpy(tmp_path, cifs_sb->tcon->treeName, l_max_len); - strcat(tmp_path, search_path); tmp_path[l_max_len-1] = 0; + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) + for (i = 0; i < l_max_len; i++) { + if (tmp_path[i] == '\\') + tmp_path[i] = '/'; + } + strncat(tmp_path, search_path, l_max_len - strlen(tmp_path)); + full_path = tmp_path; kfree(search_path); } else { -- 1.5.3.7 --------------050407010007040401010903--