Long file names for hfs is 31 characters. Signed-off-by: Yangtao Li <frank.li@xxxxxxxx> --- fs/hfs/dir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index 86a6b317b474..30f6194da939 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs/dir.c @@ -25,6 +25,9 @@ static struct dentry *hfs_lookup(struct inode *dir, struct dentry *dentry, struct inode *inode = NULL; int res; + if (dentry->d_name.len > HFS_NAMELEN) + return ERR_PTR(-ENAMETOOLONG); + res = hfs_find_init(HFS_SB(dir->i_sb)->cat_tree, &fd); if (res) return ERR_PTR(res); -- 2.48.1