]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: avoid garbage lenghs in dentries
authorJaegeuk Kim <jaegeuk@kernel.org>
Fri, 12 Feb 2016 22:29:28 +0000 (14:29 -0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 23 Feb 2016 00:07:23 +0000 (16:07 -0800)
commitcb538f4cedc1459d6e9ca2b798a3c27f9928f908
treeaa7dc0b3d0e970d148bd16aac0771bfbcca1a81f
parent7aa6fd24f8fd1555173fffc3e56b487e06217cc8
f2fs: avoid garbage lenghs in dentries

This patch fixes to eliminate garbage name lengths in dentries in order
to provide correct answers of readdir.

For example, if a valid dentry consists of:
 bitmap : 1   1 1 1
 len    : 32  0 x 0,

readdir can start with second bit_pos having len = 0.
Or, it can start with third bit_pos having garbage.

In both of cases, we should avoid to try filling dentries.
So, this patch not only removes any garbage length, but also avoid entering
zero length case in readdir.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/dir.c