]> www.infradead.org Git - users/hch/misc.git/commit
xfs: fix zero byte checking in the superblock scrubber
authorDarrick J. Wong <djwong@kernel.org>
Mon, 2 Dec 2024 18:57:42 +0000 (10:57 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 13 Dec 2024 01:45:13 +0000 (17:45 -0800)
commitc004a793e0ec34047c3bd423bcd8966f5fac88dc
treeff165cab630365f859d67d7cd522f24d70a4e9f9
parent06b20ef09ba16374e1e68f1e8dbe434c4ad4e6fd
xfs: fix zero byte checking in the superblock scrubber

The logic to check that the region past the end of the superblock is all
zeroes is wrong -- we don't want to check only the bytes past the end of
the maximally sized ondisk superblock structure as currently defined in
xfs_format.h; we want to check the bytes beyond the end of the ondisk as
defined by the feature bits.

Port the superblock size logic from xfs_repair and then put it to use in
xfs_scrub.

Cc: <stable@vger.kernel.org> # v4.15
Fixes: 21fb4cb1981ef7 ("xfs: scrub the secondary superblocks")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/agheader.c