summaryrefslogtreecommitdiffstats
path: root/fs/cifs/dir.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-09-25 12:26:59 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-09-25 12:26:59 -0400
commit363e065c02b1273364d5356711a83e7f548fc0c8 (patch)
tree0df0e65da403ade33ade580c2770c97437b1b1af /fs/cifs/dir.c
parent907b9bceb41fa46beae93f79cc4a2247df502c0f (diff)
parent7c250413e5b7c3dfae89354725b70c76d7621395 (diff)
downloadop-kernel-dev-363e065c02b1273364d5356711a83e7f548fc0c8.zip
op-kernel-dev-363e065c02b1273364d5356711a83e7f548fc0c8.tar.gz
[GFS2] Fix up merge of Linus' kernel into GFS2
This fixes up a couple of conflicts when merging up with Linus' latest kernel. This will hopefully allow GFS2 to be more easily merged into forthcoming -mm and FC kernels due to the "one line per header" format now used for the kernel headers. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Conflicts: include/linux/Kbuild include/linux/kernel.h
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r--fs/cifs/dir.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 914239d5..66b825a 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -46,7 +46,8 @@ char *
build_path_from_dentry(struct dentry *direntry)
{
struct dentry *temp;
- int namelen = 0;
+ int namelen;
+ int pplen;
char *full_path;
char dirsep;
@@ -56,7 +57,9 @@ build_path_from_dentry(struct dentry *direntry)
when the server crashed */
dirsep = CIFS_DIR_SEP(CIFS_SB(direntry->d_sb));
+ pplen = CIFS_SB(direntry->d_sb)->prepathlen;
cifs_bp_rename_retry:
+ namelen = pplen;
for (temp = direntry; !IS_ROOT(temp);) {
namelen += (1 + temp->d_name.len);
temp = temp->d_parent;
@@ -70,7 +73,6 @@ cifs_bp_rename_retry:
if(full_path == NULL)
return full_path;
full_path[namelen] = 0; /* trailing null */
-
for (temp = direntry; !IS_ROOT(temp);) {
namelen -= 1 + temp->d_name.len;
if (namelen < 0) {
@@ -79,7 +81,7 @@ cifs_bp_rename_retry:
full_path[namelen] = dirsep;
strncpy(full_path + namelen + 1, temp->d_name.name,
temp->d_name.len);
- cFYI(0, (" name: %s ", full_path + namelen));
+ cFYI(0, ("name: %s", full_path + namelen));
}
temp = temp->d_parent;
if(temp == NULL) {
@@ -88,18 +90,23 @@ cifs_bp_rename_retry:
return NULL;
}
}
- if (namelen != 0) {
+ if (namelen != pplen) {
cERROR(1,
- ("We did not end path lookup where we expected namelen is %d",
+ ("did not end path lookup where expected namelen is %d",
namelen));
- /* presumably this is only possible if we were racing with a rename
+ /* presumably this is only possible if racing with a rename
of one of the parent directories (we can not lock the dentries
above us to prevent this, but retrying should be harmless) */
kfree(full_path);
- namelen = 0;
goto cifs_bp_rename_retry;
}
-
+ /* DIR_SEP already set for byte 0 / vs \ but not for
+ subsequent slashes in prepath which currently must
+ be entered the right way - not sure if there is an alternative
+ since the '\' is a valid posix character so we can not switch
+ those safely to '/' if any are found in the middle of the prepath */
+ /* BB test paths to Windows with '/' in the midst of prepath */
+ strncpy(full_path,CIFS_SB(direntry->d_sb)->prepath,pplen);
return full_path;
}
OpenPOWER on IntegriCloud