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

Next file: linux/fs/umsdos/emd.c
Previous file: linux/fs/umsdos/check.c
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from ../../exclude v2.2.14/fs/umsdos/dir.c linux/fs/umsdos/dir.c
@@ -597,6 +597,13 @@
 	return ret;
 }
 
+/*
+ * looks up REAL DOS filename and returns result dentry
+ *
+ * NOTE: since it is looked via UMSDOS_rlookup, it will not have i_patched,
+ * umsdos_i.pos and other EMD-related stuff ! Moreover, it will destroy them
+ * if such dentry was pre-existant.
+ */
 struct dentry *umsdos_covered(struct dentry *parent, char *name, int len)
 {
 	struct dentry *result, *dentry;
@@ -674,7 +681,7 @@
 	if (*path == '/')
 		path++; /* skip leading '/' */
 
-	if (old_root->d_inode == pseudo_root)
+	if (current->fs->root->d_inode == pseudo_root)
 	{
 		*(path-1) = '/';
 		path -= (UMSDOS_PSDROOT_LEN+1);
@@ -718,6 +725,7 @@
 	filp.f_flags = O_RDONLY;
 
 	len = umsdos_file_read_kmem (&filp, path, hlink->d_inode->i_size);
+	if ((len > 0) && (len < PATH_MAX)) path[len] = '\0';
 	if (len != hlink->d_inode->i_size)
 		goto out_noread;
 #ifdef UMSDOS_DEBUG_VERBOSE

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