linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Steve French" <smfrench@gmail.com>
To: "Jeremy Allison" <jra@samba.org>,
	"Q (Igor Mammedov)" <qwerty0987654321@mail.ru>,
	"Igor Mammedov" <niallain@gmail.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: dfs path construction fixup for / character in \\server\share component of dfs path
Date: Fri, 18 Apr 2008 18:03:15 -0500	[thread overview]
Message-ID: <524f69650804181603x201f220as14cfd72eaeba5d48@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 526 bytes --]

Attached is dfs path construction fixup for / character in
\\server\share component of dfs path.  Let me know if you see any
problem - but it gets Samba past the problem with not returning
STATUS_PATH_NOT_COVERED

similar change will have to be made to build_full_dfs_path_from_dentry
in cifs_dfs_ref.c

This makes it easier for me to test the remainder of the changes
needed to the SMB GetDFSReferral function(s).  Has anyone checked on
the answer to Al's question on submount expiry from a few days ago?

-- 
Thanks,

Steve

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: dfs-slash-in-unc.patch --]
[-- Type: text/x-diff; name=dfs-slash-in-unc.patch, Size: 1768 bytes --]

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index bc673c8..e1031b9 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -161,12 +161,14 @@ static void cifs_unix_info_to_inode(struct inode *inode,
 	spin_unlock(&inode->i_lock);
 }
 
-static const unsigned char *cifs_get_search_path(struct cifsTconInfo *pTcon,
-					const char *search_path)
+static const unsigned char *cifs_get_search_path(struct cifs_sb_info *cifs_sb,
+						const char *search_path)
 {
 	int tree_len;
 	int path_len;
+	int i;
 	char *tmp_path;
+	struct cifsTconInfo *pTcon = cifs_sb->tcon;
 
 	if (!(pTcon->Flags & SMB_SHARE_IS_IN_DFS))
 		return search_path;
@@ -180,6 +182,11 @@ static const unsigned char *cifs_get_search_path(struct cifsTconInfo *pTcon,
 		return search_path;
 
 	strncpy(tmp_path, pTcon->treeName, tree_len);
+	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
+		for (i = 0; i < tree_len; i++) {
+			if (tmp_path[i] == '\\')
+				tmp_path[i] = '/';
+		}
 	strncpy(tmp_path+tree_len, search_path, path_len);
 	tmp_path[tree_len+path_len] = 0;
 	return tmp_path;
@@ -199,7 +206,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
 	pTcon = cifs_sb->tcon;
 	cFYI(1, ("Getting info on %s", search_path));
 
-	full_path = cifs_get_search_path(pTcon, search_path);
+	full_path = cifs_get_search_path(cifs_sb, search_path);
 
 try_again_CIFSSMBUnixQPathInfo:
 	/* could have done a find first instead but this returns more info */
@@ -402,7 +409,7 @@ int cifs_get_inode_info(struct inode **pinode,
 			return -ENOMEM;
 		pfindData = (FILE_ALL_INFO *)buf;
 
-		full_path = cifs_get_search_path(pTcon, search_path);
+		full_path = cifs_get_search_path(cifs_sb, search_path);
 
 try_again_CIFSSMBQPathInfo:
 		/* could do find first instead but this returns more info */

             reply	other threads:[~2008-04-18 23:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-18 23:03 Steve French [this message]
2008-04-23 14:28 ` dfs path construction fixup for / character in \\server\share component of dfs path Igor Mammedov
2008-04-23 19:11   ` Jeremy Allison
2008-04-23 19:19     ` Jeremy Allison
2008-04-24  8:04       ` Igor Mammedov
2008-04-25 19:22         ` Jeremy Allison
2008-04-25 19:50           ` Jeremy Allison
2008-04-25 21:16         ` Jeremy Allison
2008-04-27 13:00           ` Igor Mammedov
2008-04-28 18:05             ` Jeremy Allison
2008-04-28 18:51             ` Jeremy Allison
2008-05-21 13:57               ` Igor Mammedov
2008-05-24  0:46                 ` Jeremy Allison
2008-05-24  1:33                   ` Steve French

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=524f69650804181603x201f220as14cfd72eaeba5d48@mail.gmail.com \
    --to=smfrench@gmail.com \
    --cc=jra@samba.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=niallain@gmail.com \
    --cc=qwerty0987654321@mail.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).