mkfs.erofs: should MAX_BLOCK_SIZE be tied to build host page size?

Matthew Lear matthew.lear at raspberrypi.com
Wed Feb 25 03:02:24 AEDT 2026


Hi Gao Xiang,

Thank you for the quick reply.

>> Is there scope to increase the default block size ceiling of mkfs.erofs
>> to 16K (or perhaps increase it to 16K for aarch64 compilations)?
>
> I think the reasonable maximum block size for EROFS should be no
> more than 64k.
>
> I think we could consider set the MAX_BLOCK_SIZE to 64k for
> aarch64, but leave it to the page size if `-b` is unspecified.
>
> Would you mind submitting a patch for this (checking the target
> arch, if aarch64, set MAX_BLOCK_SIZE to 64k instead) since I've
> already had a bunch of other stuffs.

A change in configure.ac to do this looks straight-forward enough (I
think), but there may be justified concerns about the knock-on effects,
particularly as MAX_BLOCK_SIZE is used in various arrays. With 16K (4x
today), these would all increase quite a bit:

lib/liberofs_cache.h:  struct list_head watermeter[META +
1][2][EROFS_MAX_BLOCK_SIZE];
lib/namei.c:           char buf[EROFS_MAX_BLOCK_SIZE];
lib/dir.c:             char buf[EROFS_MAX_BLOCK_SIZE];
lib/data.c:            u8 buf[EROFS_MAX_BLOCK_SIZE];
lib/super.c:           u8 data[EROFS_MAX_BLOCK_SIZE];

With 64K, the memory footprint would be significantly larger.
What do you think?
--  Matt


More information about the Linux-erofs mailing list