]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: check filename length in recover_dentry
authorChao Yu <chao2.yu@samsung.com>
Mon, 23 Dec 2013 03:12:21 +0000 (11:12 +0800)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Thu, 26 Dec 2013 03:50:09 +0000 (12:50 +0900)
commited7be4359f390c91f3bd943c6eaa976df5ff7da0
treedb3e4c190ef10f0337e1e63369fb4f3565dda30d
parent30b4a2f577eca1ae3c9e30b5c399b161d172682b
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>
fs/f2fs/dir.c
fs/f2fs/recovery.c