Long file names for hfs is 255 characters. Signed-off-by: Yangtao Li <frank.li@xxxxxxxx> --- fs/hfsplus/dir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index 876bbb80fb4d..d8fb401e7fdc 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c @@ -38,6 +38,9 @@ static struct dentry *hfsplus_lookup(struct inode *dir, struct dentry *dentry, u32 cnid, linkid = 0; u16 type; + if (dentry->d_name.len > HFSPLUS_MAX_STRLEN) + return ERR_PTR(-ENAMETOOLONG); + sb = dir->i_sb; dentry->d_fsdata = NULL; -- 2.48.1