public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] mdrestore: fix restore_v2() superblock length check
@ 2025-12-09 22:58 Pavel Reichl
  2025-12-09 22:58 ` [PATCH v2 1/1] " Pavel Reichl
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Reichl @ 2025-12-09 22:58 UTC (permalink / raw)
  To: linux-xfs; +Cc: djwong, chandanbabu, aalbersh

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(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-12-10  7:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-09 22:58 [PATCH v2 0/1] mdrestore: fix restore_v2() superblock length check Pavel Reichl
2025-12-09 22:58 ` [PATCH v2 1/1] " Pavel Reichl
2025-12-10  0:07   ` Darrick J. Wong
2025-12-10  5:28   ` Christoph Hellwig
2025-12-10  7:07   ` Chandan Babu R

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox