]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_repair: handling a block with bad crc, bad uuid, and bad magic number needs fixing
authorBill O'Donnell <bodonnel@redhat.com>
Fri, 21 Mar 2025 22:05:35 +0000 (17:05 -0500)
committerAndrey Albershteyn <aalbersh@kernel.org>
Mon, 31 Mar 2025 12:00:34 +0000 (14:00 +0200)
commit8cd85addd72f1f6e569bd286f6a44dfce90355f1
tree21eb298b15548ee7e5dd1635d10aca9ba7c7ca90
parent0b4156b99b2a5af1fdb04ad26911520d41b9ce87
xfs_repair: handling a block with bad crc, bad uuid, and bad magic number needs fixing

In certain cases, if a block is so messed up that crc, uuid and magic
number are all bad, we need to not only detect in phase3 but fix it
properly in phase6. In the current code, the mechanism doesn't work
in that it only pays attention to one of the parameters.

Note: in this case, the nlink inode link count drops to 1, but
re-running xfs_repair fixes it back to 2. This is a side effect that
should probably be handled in update_inode_nlinks() with separate patch.
Regardless, running xfs_repair twice, with this patch applied
fixes the issue. Recognize that this patch is a fix for xfs v5.

Signed-off-by: Bill O'Donnell <bodonnel@redhat.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
v2: remove superfluous needmagic logic
v3: clarify the description
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
repair/phase6.c