Skip to content

Commit

Permalink
9p: Creating files with names too long should fail with ENAMETOOLONG.
Browse files Browse the repository at this point in the history
Signed-off-by: Sripathi Kodi <sripathik@in.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
  • Loading branch information
Sripathi Kodi authored and Eric Van Hensbergen committed Apr 5, 2010
1 parent 6d96d3a commit 11e9b49
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/9p/vfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,9 @@ static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
P9_DPRINTK(P9_DEBUG_VFS, "dir: %p dentry: (%s) %p nameidata: %p\n",
dir, dentry->d_name.name, dentry, nameidata);

if (dentry->d_name.len > NAME_MAX)
return ERR_PTR(-ENAMETOOLONG);

sb = dir->i_sb;
v9ses = v9fs_inode2v9ses(dir);
dfid = v9fs_fid_lookup(dentry->d_parent);
Expand Down

0 comments on commit 11e9b49

Please sign in to comment.