From: Daeho Jeong <daehoje...@google.com>

Otherwise, it doesn't work with a crash.

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

diff --git a/lib/libf2fs.c b/lib/libf2fs.c
index d2579d7..148dc12 100644
--- a/lib/libf2fs.c
+++ b/lib/libf2fs.c
@@ -1347,6 +1347,11 @@ int f2fs_get_f2fs_info(void)
                        }
                        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;
+               }
 
                /*
                 * Align sections to the device zone size and align F2FS zones
-- 
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

Reply via email to