[PATCH 3/3] btrfs-progs: convert: check the sectorsize against BTRFS_MIN_BLOCKSIZE

Qu Wenruo
2025-02-26T03:59:57Z

This allow experimental btrfs-convert builds to handle 2K block sized
ext4, which is needed to pass convert related test cases in fstests.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
convert/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/convert/main.c b/convert/main.c
index edc2c0d97c29..0dc75c9eb1c6 100644
--- a/convert/main.c
+++ b/convert/main.c
@@ -1201,7 +1201,7 @@ static int do_convert(const char *devname, u32 convert_flags, u32 nodesize,

UASSERT(cctx.total_bytes != 0);
blocksize = cctx.blocksize;
- if (blocksize < 4096) {
+ if (blocksize < BTRFS_MIN_BLOCKSIZE) {
error("block size is too small: %u < 4096", blocksize);
goto fail;
}
--
2.48.1