diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2006-04-17 21:05:46 -0400 |
---|---|---|
committer | Richard Purdie <richard@tim.rpsys.net> | 2006-04-17 21:05:46 -0400 |
commit | 373d5e71833978fe3d91264d86857762bb92cfe2 (patch) | |
tree | 0c56caf25b684d7022ba023bcbdf8f963548d6e1 | |
parent | 6e62e8c2c7b1e3387d73ecb3f7539314b7a9931e (diff) |
JFFS2: Return an error for long filenames
Return an error if a name is too long for JFFS2 rather than
corrupting data.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
-rw-r--r-- | fs/jffs2/dir.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index 8bc7a5018e40..f92840a3a52f 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c | |||
@@ -78,6 +78,9 @@ static struct dentry *jffs2_lookup(struct inode *dir_i, struct dentry *target, | |||
78 | 78 | ||
79 | D1(printk(KERN_DEBUG "jffs2_lookup()\n")); | 79 | D1(printk(KERN_DEBUG "jffs2_lookup()\n")); |
80 | 80 | ||
81 | if (target->d_name.len > JFFS2_MAX_NAME_LEN) | ||
82 | return ERR_PTR(-ENAMETOOLONG); | ||
83 | |||
81 | dir_f = JFFS2_INODE_INFO(dir_i); | 84 | dir_f = JFFS2_INODE_INFO(dir_i); |
82 | c = JFFS2_SB_INFO(dir_i->i_sb); | 85 | c = JFFS2_SB_INFO(dir_i->i_sb); |
83 | 86 | ||