]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: fix zero byte checking in the superblock scrubber
authorDarrick J. Wong <djwong@kernel.org>
Wed, 18 Dec 2024 19:51:23 +0000 (11:51 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Dec 2024 13:02:01 +0000 (14:02 +0100)
commitbc1f8a86e34a0706c6935e34cfc0fb47c2939e14
tree7ff502f9c8e89ba7bd3042728decf475f62b654c
parent07f2f8083a7ae22eb26e0a642e9ccc465d759b2b
xfs: fix zero byte checking in the superblock scrubber

commit c004a793e0ec34047c3bd423bcd8966f5fac88dc upstream.

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/xfs/scrub/agheader.c