mkfs.f2fs: fix to calculate left space of checkpoint page correctly
authorChao Yu <chao2.yu@samsung.com>
Mon, 14 Dec 2015 10:06:59 +0000 (18:06 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 14 Dec 2015 18:11:48 +0000 (10:11 -0800)
commit0fddd6e563ab19c379ad9bbb3039b38d5e8e047c
treed430f0ce209ebd7eea45c69c525b727585901fe6
parent2c1ebe237acb9b1e8093f9aecd0c92b53583877b
mkfs.f2fs: fix to calculate left space of checkpoint page correctly

We reserved one segment for NAT region at least, so when formatting
fs, calculated maximum size of left space in CP page should be:
CHECKSUM_OFFSET - sizeof(struct f2fs_checkpoint) + 1 - 64 (size of
reserved NAT bitmap).

Fix the incorrect calculated size to avoid potential overflow bug here.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
mkfs/f2fs_format.c