From 0255d52ebf3ce596804d6a631c61e6039b2bf271 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Tue, 28 Jan 2014 19:23:57 +0900 Subject: [PATCH] mkfs: fix the wrong nat bitmap size We should consider checksum bytes in the checkpoint block. Previously, this bug incured very critical panics for node entry handling. Signed-off-by: Jaegeuk Kim --- mkfs/f2fs_format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index 8297ce8..1be1552 100644 --- a/mkfs/f2fs_format.c +++ b/mkfs/f2fs_format.c @@ -299,7 +299,7 @@ static int f2fs_prepare_super_block(void) */ sit_bitmap_size = ((le32_to_cpu(super_block.segment_count_sit) / 2) << log_blks_per_seg) / 8; - max_nat_bitmap_size = 4096 - sizeof(struct f2fs_checkpoint) + 1 - + max_nat_bitmap_size = CHECKSUM_OFFSET - sizeof(struct f2fs_checkpoint) + 1 - sit_bitmap_size; max_nat_segments = (max_nat_bitmap_size * 8) >> log_blks_per_seg; -- 2.7.4