[PATCH erofs-utils v2 0/2] Fix 48-bit block addressing for extra devices

Zhan Xusheng zhanxusheng1024 at gmail.com
Sat Apr 4 00:05:44 AEDT 2026


The 48-bit block addressing support extended the on-disk
erofs_deviceslot with blocks_hi and uniaddr_hi fields, but the read
and write paths for extra devices were not updated.

Additionally, erofs_read_superblock() has a swapped hi/lo combination
for the primary device blocks -- the same bug fixed in the kernel by
0b96d9bed324 ("erofs: fix block count report when 48-bit layout is
on").

Patch 1 fixes the primary device blocks read order.
Patch 2 adds read/write support for 48-bit extra device fields, and
syncs the erofs_deviceslot definition (blocks_hi: __le32 -> __le16)
with the kernel.

A corresponding kernel-side fix has been reviewed:
  ("erofs: handle 48-bit blocks/uniaddr for extra devices")

Changes since v1:
  - Use ternary expression for the read path to match the kernel
    implementation style, as suggested by Gao Xiang.
  - Cc linux-erofs mailing list.

Zhan Xusheng (2):
  erofs-utils: fix swapped hi/lo in 48-bit primary blocks read
  erofs-utils: handle 48-bit blocks/uniaddr for extra devices

 include/erofs_fs.h |  4 ++--
 lib/super.c        | 14 ++++++++++----
 2 files changed, 12 insertions(+), 6 deletions(-)

--
2.43.0



More information about the Linux-erofs mailing list