summaryrefslogtreecommitdiff
path: root/fs/f2fs/dir.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2013-12-23 03:12:21 (GMT)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-12-26 03:50:09 (GMT)
commitd96b143151a11820ee3eee552554209f2453799e (patch)
treedb3e4c190ef10f0337e1e63369fb4f3565dda30d /fs/f2fs/dir.c
parentdeead09009fc5136185fe95026c395b5c2337e1f (diff)
downloadlinux-d96b143151a11820ee3eee552554209f2453799e.tar.xz
f2fs: check filename length in recover_dentry
In current flow, we will get Null return value of f2fs_find_entry in recover_dentry when name.len is bigger than F2FS_NAME_LEN, and then we still add this inode into its dir entry. To avoid this situation, we must check filename length before we use it. Another point is that we could remove the code of checking filename length In f2fs_find_entry, because f2fs_lookup will be called previously to ensure of validity of filename length. V2: o add WARN_ON() as Jaegeuk Kim suggested. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/dir.c')
-rw-r--r--fs/f2fs/dir.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index 07ad850..f0b4630 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -190,9 +190,6 @@ struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir,
unsigned int max_depth;
unsigned int level;
- if (unlikely(namelen > F2FS_NAME_LEN))
- return NULL;
-
if (npages == 0)
return NULL;