Skip to content

Fix 48-bit block addressing for extra devices

Zhan Xusheng linux-erofs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 4 repliesIn review

Changes in v2 from the cover letter

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

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2erofs-utils: fix swapped hi/lo in 48-bit primary blocks readlib/super.c+2 -22 replies
2/2erofs-utils: handle 48-bit blocks/uniaddr for extra devicesinclude/erofs_fs.h lib/super.c+10 -42 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

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

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