Skip to contentSkip to conversation

mkfs.f2fs: ensure zone size is equal or bigger than segment size

PATCH Superseded Daeho Jeong 1 participant 1 message May 22, 2025 Library code

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mkfs.f2fs: ensure zone size is equal or bigger than segment size

From: Daeho Jeong <[email protected]>

Otherwise, it doesn't work with a crash.

---
 lib/libf2fs.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/libf2fs.c +5 -0
index d2579d7..396e22c 100644
@@ -1346,6 +1346,11 @@ int f2fs_get_f2fs_info(void)
 				return -1;
 			}
 			c.zone_blocks = c.devices[i].zone_blocks;
+			if (c.zone_blocks < DEFAULT_BLOCKS_PER_SEGMENT) {
+				MSG(0, "\tError: zone size should not be less "
+					"than segment size\n");
+				return -1;
+			}
 		}
 
 		/*
Signature · 1 line
2.49.0.1151.ga128411c76-goog