f2fs: avoid overflow when large directory feathure is enabled
authorChao Yu <chao2.yu@samsung.com>
Wed, 28 May 2014 00:56:09 +0000 (08:56 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 4 Jun 2014 04:34:30 +0000 (13:34 +0900)
When large directory feathure is enable, We have one case which could cause
overflow in dir_buckets() as following:
special case: level + dir_level >= 32 and level < MAX_DIR_HASH_DEPTH / 2.

Here we define MAX_DIR_BUCKETS to limit the return value when the condition
could trigger potential overflow.

Changes from V1
 o modify description of calculation in f2fs.txt suggested by Changman Lee.

Suggested-by: Changman Lee <cm224.lee@samsung.com>
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

No differences found