linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] mkfs.f2fs: ensure zone size is equal or bigger than segment size
@ 2025-05-22 18:24 Daeho Jeong
  0 siblings, 0 replies; only message in thread
From: Daeho Jeong @ 2025-05-22 18:24 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Daeho Jeong

From: Daeho Jeong <daehojeong@google.com>

Otherwise, it doesn't work with a crash.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
---
 lib/libf2fs.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/libf2fs.c b/lib/libf2fs.c
index d2579d7..396e22c 100644
--- a/lib/libf2fs.c
+++ b/lib/libf2fs.c
@@ -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;
+			}
 		}
 
 		/*
-- 
2.49.0.1151.ga128411c76-goog



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-05-22 18:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-22 18:24 [f2fs-dev] [PATCH] mkfs.f2fs: ensure zone size is equal or bigger than segment size Daeho Jeong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).