[PATCH] tmpfs 1/7 LTP ENAMETOOLONG

From: Hugh Dickins
Date: Wed Oct 15 2003 - 13:19:53 EST


First of 2+3+2 tmpfs patches, based on 2.6.0-test7-mm1, total diffstat:

fs/hugetlbfs/inode.c | 20 +++++++++++++---
fs/libfs.c | 2 +
fs/ramfs/inode.c | 7 +++++
mm/shmem.c | 63 +++++++++++++++++++++++++++++++++++++++++----------
4 files changed, 77 insertions(+), 15 deletions(-)

[PATCH] tmpfs 1/7 LTP ENAMETOOLONG

LTP tests the filesystem on /tmp: many failures when tmpfs because
simple_lookup forgot to reject filenames longer than the NAME_MAX
tmpfs declares in its statfs. This also fixes ramfs and hugetlbfs.

--- 2.6.0-test7-mm1/fs/libfs.c 2003-10-08 20:24:55.000000000 +0100
+++ tmpfs1/fs/libfs.c 2003-10-15 15:38:30.349562896 +0100
@@ -32,6 +32,8 @@

struct dentry *simple_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
{
+ if (dentry->d_name.len > NAME_MAX)
+ return ERR_PTR(-ENAMETOOLONG);
d_add(dentry, NULL);
return NULL;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/