Meta area is not included in section_count computation.
The code in mkfs/f2fs_format.c is:
total_zones = get_sb(segment_count) / (c.segs_per_zone) -
total_meta_zones;
set_sb(section_count, total_zones * c.secs_per_zone);
So the minimum total_sections is 1.
Signed-off-by: Xiaojun Wang <[email protected]>
---
fs/f2fs/super.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index dfa072fa8081..a450c8589841 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2799,8 +2799,7 @@ static int sanity_check_raw_super(struct f2fs_sb_info
*sbi,
return -EFSCORRUPTED;
}
- if (total_sections > segment_count ||
- total_sections < F2FS_MIN_SEGMENTS ||
+ if (total_sections > segment_count || total_sections < 1 ||
segs_per_sec > segment_count || !segs_per_sec) {
f2fs_info(sbi, "Invalid segment/section count (%u, %u x %u)",
segment_count, total_sections, segs_per_sec);
--
2.25.1
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel