diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-09-28 12:27:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-09-28 18:36:42 -0400 |
commit | 54af3bb543c071769141387a42deaaab5074da55 (patch) | |
tree | d24e5b23462a51a4e932b14feb5ae943b0dbba1e /fs/nfs/dir.c | |
parent | bd8936632475665bfd90c1180c9c1301ee838db8 (diff) |
NFS: Fix an Oops in encode_lookup()
It doesn't look as if the NFS file name limit is being initialised correctly
in the struct nfs_server. Make sure that we limit whatever is being set in
nfs_probe_fsinfo() and nfs_init_server().
Also ensure that readdirplus and nfs4_path_walk respect our file name
limits.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index ea97408e423e..e4a04d16b8b0 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -1162,6 +1162,8 @@ static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc) | |||
1162 | } | 1162 | } |
1163 | if (!desc->plus || !(entry->fattr->valid & NFS_ATTR_FATTR)) | 1163 | if (!desc->plus || !(entry->fattr->valid & NFS_ATTR_FATTR)) |
1164 | return NULL; | 1164 | return NULL; |
1165 | if (name.len > NFS_SERVER(dir)->namelen) | ||
1166 | return NULL; | ||
1165 | /* Note: caller is already holding the dir->i_mutex! */ | 1167 | /* Note: caller is already holding the dir->i_mutex! */ |
1166 | dentry = d_alloc(parent, &name); | 1168 | dentry = d_alloc(parent, &name); |
1167 | if (dentry == NULL) | 1169 | if (dentry == NULL) |