🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #3201

Bug#1152993: erofs-utils: please build with MAX_BLOCK_SIZE=65536 (64 KiB-block images on aarch64)

#3201
From: Ping Li
Date: Wed, 04 Nov 2026 08:20
81 lines
5647 bytes
Package: erofs-utils
Version: 1.9.4-1
Severity: wishlist
Tags: patch

Hi Xiang,

erofs-utils hard-codes its maximum supported block size at build time:
configure sets EROFS_MAX_BLOCK_SIZE either from the MAX_BLOCK_SIZE
environment variable, or by probing sysconf(_SC_PAGESIZE) on the
*build* host (falling back to 4096 when cross-compiling, and to a
16 KiB minimum on aarch64 since 1.9).

EROFS images created on aarch64 systems running 64 KiB-page kernels
use blkszbits=16. Since the arm64 buildds run 4 KiB-page kernels,
the shipped binaries reject such images:

  $ fsck.erofs /dev/disk/by-label/app
  <E> erofs: blksize 65536 isn't supported on this platform
  <E> erofs: failed to read superblock

All consumers are affected: fsck.erofs, dump.erofs, erofsfuse and
mount.erofs. Note that on trixie (1.8.6) the cap is 4096, so even
16 KiB-block images are rejected there.

I verified this on an arm64 device running a 64 KiB-page kernel:
fsck.erofs 1.8.6 from trixie rejects both 16 KiB and 64 KiB images,
while a build with EROFS_MAX_BLOCK_SIZE=65536 checks both fine.

No source change is needed: the attached debdiff exports
MAX_BLOCK_SIZE=65536 in debian/rules, which is the documented
autoconf argument variable for exactly this purpose. The larger
limit only grows a few on-stack buffers (64 KiB instead of 4/16 KiB
in erofs_read_superblock() and friends), which is fine with the
default 8 MiB thread stack - upstream already ships 16 KiB buffers
on aarch64.

Reproducer:

  mkfs.erofs -b 65536 img.erofs srcdir/
  fsck.erofs img.erofs

I rebuilt the package with the attached debdiff and verified that
the resulting fsck.erofs checks both 16 KiB and 64 KiB blocksize
images successfully.

Thanks,
Ping Li

diff -Nru erofs-utils-1.9.4/debian/changelog erofs-utils-1.9.4/debian/changelog
--- erofs-utils-1.9.4/debian/changelog	2026-08-19 20:00:00.000000000 +0800
+++ erofs-utils-1.9.4/debian/changelog	2026-11-04 15:57:18.070014646 +0800
@@ -1,3 +1,11 @@
+erofs-utils (1.9.4-1.1) UNRELEASED; urgency=medium
+
+  * Build with MAX_BLOCK_SIZE=65536 so that fsck.erofs & co. accept
+    EROFS images with 64 KiB blocks (as created on aarch64 systems
+    running 64 KiB-page kernels).
+
+ -- Ping Li <leeonion.muyu@gmail.com>  Wed, 04 Nov 2026 15:57:12 +0800
+
 erofs-utils (1.9.4-1) unstable; urgency=medium

   * New upstream release 1.9.4.
diff -Nru erofs-utils-1.9.4/debian/rules erofs-utils-1.9.4/debian/rules
--- erofs-utils-1.9.4/debian/rules	2026-08-19 20:00:00.000000000 +0800
+++ erofs-utils-1.9.4/debian/rules	2026-11-04 15:19:41.829224626 +0800
@@ -4,6 +4,13 @@

 export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow

+# erofs-utils hard-codes its maximum supported block size at build time;
+# configure otherwise probes the build host's page size, which caps arm64
+# builds at 16 KiB (or 4 KiB on 4 KiB-page buildds).  EROFS images with
+# 64 KiB blocks (aarch64 64 KiB-page kernels) then fail with:
+#   <E> erofs: blksize 65536 isn't supported on this platform
+export MAX_BLOCK_SIZE = 65536
+
 ifneq ($(DEB_TARGET_ARCH_OS),linux)
 SKIP_FUSE2FS=yes
 SKIP_SELINUX=yes
Technical Details
Message-ID: <NVEnT-9LtD-3@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.corradoroberto.it!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.corradoroberto.it!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Ping Li <leeonion.muyu@gmail.com>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1152993: erofs-utils: please build with MAX_BLOCK_SIZE=65536 (64 KiB-block images on aarch64)
Date: Wed, 04 Nov 2026 09:20:01 +0100
Message-ID: <NVEnT-9LtD-3@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Wed Nov  4 08:17:08 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -0.547
Reply-To: Ping Li <leeonion.muyu@gmail.com>, 1152993@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: xiang@kernel.org
X-Debian-Pr-Message: report 1152993
X-Debian-Pr-Package: erofs-utils
X-Debian-Pr-Keywords: patch
X-Debian-Pr-Source: erofs-utils
X-Gm-Message-State: APuU4Z+9IUMYubTnStQ3nIOIzF+X1M6C8TbTCEmUqs7g/jUAi1LRayjq
	3Ads2M+Ueax+Hg2EBGfteyM2TO0ncbvWJYFdxdSEXqqSVYI0Vlsz9eRcw+CtF8zi
X-Gm-Gg: AYBFou2agd5jfJfpdUhj4kJVFUfSRQreYVRRiP+Dyz9HVuXbrrH/Fd4+It0Vhd16Ne0
	MWjU/1toNaOZpBy2u8pU72cgEPpBc+Z9SY/myqW+onHfafFXt2lAtSiCu5TFSXFnYlw70+G/LrI
	qXPSXHzk6oSxCedM8zmj+fLf6PXww2Q7U3xTyhdQs8ko9N/8Bmb5TdcbUNs4ZAfYXW1qKJVeOba
	U2p9/96cwi5C+Rsv54TeVhlp7r39pJumyBsqRE4E7V/Jn4Vr01w246b5t8e3YdGAM3HQZKpRn38
	LVBOLlgK16gP/EK9X1WVtIthBwcOxT0rFREynZml1XQV50oRGzfOdhWrrXVBheq63J5noS2MabW
	du2cMRfOIARUvj4fpeqrk1mCycsEWgzLLt22Radry8UA4wD3gXXy6WHkbIt/n5+AZw09EXFbwnY
	Z8MaUtut+HyeOY7A8j7pAsqUNVNEvAHYLa1rAkVt/Y6NS7uOhnCAmtShHGhYUqrZwBDP5O23Cqf
	jZqMJDpVGT5bID+T7vIFzPci1FW5+dhEnVhVh4VjBHNDMmxRPFDsQWEyYbQtTaXfkmZ2Ye4qTOF
	HiqL6MfFi7XkyrBLyfDkFo0xABaOwlIh/g==
X-Received: by 2002:a17:90a:bd92:b0:3b0:968f:fdee with SMTP id 98e67ed59e1d1-3b0969006cbmr1035115a91.55.1793780113260;
        Wed, 04 Nov 2026 00:15:13 -0800 (PST)
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2000566
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 81
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Wed,  4 Nov 2026 16:15:09 +0800
X-Original-Message-ID: <20261104081509.307946-1-leeonion.muyu@gmail.com>