summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/zfs/zpl_inode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/module/zfs/zpl_inode.c b/module/zfs/zpl_inode.c
index e40628878..8c8ec2414 100644
--- a/module/zfs/zpl_inode.c
+++ b/module/zfs/zpl_inode.c
@@ -41,6 +41,9 @@ zpl_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
struct inode *ip;
int error;
+ if (dlen(dentry) > ZFS_MAXNAMELEN)
+ return ERR_PTR(-ENAMETOOLONG);
+
crhold(cr);
error = -zfs_lookup(dir, dname(dentry), &ip, 0, cr, NULL, NULL);
ASSERT3S(error, <=, 0);