Skip to content

mdrestore: fix restore_v2() superblock length check

Pavel Reichl linux-xfs 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest1 patch 3 repliesIn review
  2. v11 patch 5 repliesSuperseded

Changes in v2 from the cover letter

- xme.xme_len is an ondisk value so use be32_to_cpu() instead of cpu_to_be32()

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1mdrestore: fix restore_v2() superblock length checkmdrestore/xfs_mdrestore.c+1 -13 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchDarrick J. WongChristoph HellwigChandan Babu R
1/1R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/1] mdrestore: fix restore_v2() superblock length check

Hi all,

On s390x (big-endian), running xfstests -g metadump currently fails 6 out of 9 tests. The failure is triggered by the superblock extent-length validation in restore_v2(). The code rejects xme_len == 1, but a length of 1 is the correct and expected value, since the superblock fits within a single 512-byte sector.

On big-endian systems, this length decodes to 1 and the check aborts the restore. On little-endian systems, the same on-disk bytes are interpreted as 16777216, so the faulty logic never triggers there.

The patch removes the incorrect rejection of a valid extent length of 1 and applies proper logic so that the superblock extent length is validated consistently across all architectures.

The outline of the fix was discussed with Chandan (thanks).

v2:
- xme.xme_len is an ondisk value so use be32_to_cpu() instead of cpu_to_be32()

Pavel Reichl (1):
mdrestore: fix restore_v2() superblock length check

 mdrestore/xfs_mdrestore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.52.0