patch-2.3.2 linux/fs/umsdos/dir.c

Next file: linux/fs/umsdos/inode.c
Previous file: linux/fs/umsdos/README-WIP.txt
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.1/linux/fs/umsdos/dir.c linux/fs/umsdos/dir.c
@@ -670,10 +670,20 @@
 	/* N.B. not safe -- fix this soon! */
 	current->fs->root = dentry->d_sb->s_root;
 	path = d_path(dentry, buffer, len);
+
+	if (*path == '/')
+		path++; /* skip leading '/' */
+
+	if (old_root->d_inode == pseudo_root)
+	{
+		*(path-1) = '/';
+		path -= (UMSDOS_PSDROOT_LEN+1);
+		memcpy(path, UMSDOS_PSDROOT_NAME, UMSDOS_PSDROOT_LEN);
+	}
+
 	current->fs->root = old_root;
 	return path;
 }
-	
 
 /*
  * Return the dentry which points to a pseudo-hardlink.
@@ -718,7 +728,14 @@
 	/* start at root dentry */
 	dentry_dst = dget(base);
 	path[len] = '\0';
-	pt = path + 1; /* skip leading '/' */
+	
+	pt = path;
+	if (*path == '/')
+		pt++; /* skip leading '/' */
+	
+	if (base->d_inode == pseudo_root)
+		pt += (UMSDOS_PSDROOT_LEN + 1);
+	
 	while (1) {
 		struct dentry *dir = dentry_dst, *demd;
 		char *start = pt;
@@ -741,6 +758,7 @@
 dir->d_parent->d_name.name, dir->d_name.name, start, real);
 #endif
 		dentry_dst = umsdos_lookup_dentry(dir, start, len, real);
+/* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 		if (real)
 			d_drop(dir);
 		dput (dir);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)