mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git
synced 2024-11-27 11:43:36 +08:00
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 <jaegeuk.kim@samsung.com>
This commit is contained in:
parent
4f267323a2
commit
0255d52ebf
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user