Commit 6b006415 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] tmpfs 1/7 LTP ENAMETOOLONG fix

From: Hugh Dickins <hugh@veritas.com>

LTP tests the filesystem on /tmp: there are many failures when using tmpfs
because simple_lookup forgot to reject filenames longer than the NAME_MAX
tmpfs declares in its statfs.  This also fixes ramfs and hugetlbfs.
parent 16715550
...@@ -32,6 +32,8 @@ int simple_statfs(struct super_block *sb, struct kstatfs *buf) ...@@ -32,6 +32,8 @@ int simple_statfs(struct super_block *sb, struct kstatfs *buf)
struct dentry *simple_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) 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); d_add(dentry, NULL);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment