xfs: check unused nlink fields in the ondisk inode
authorDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 21:55:03 +0000 (14:55 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 21:58:59 +0000 (14:58 -0700)
commit40cb8613d6122ca80a9e42e4cecc4d308c3b80fb
treefa904ca14d9e8629c13145aa1efbc21b86f23b72
parentab97f4b1c030750f2475bf4da8a9554d02206640
xfs: check unused nlink fields in the ondisk inode

v2/v3 inodes use di_nlink and not di_onlink; and v1 inodes use di_onlink
and not di_nlink.  Whichever field is not in use, make sure its contents
are zero, and teach xfs_scrub to fix that if it is.

This clears a bunch of missing scrub failure errors in xfs/385 for
core.onlink.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_inode_buf.c
fs/xfs/scrub/inode_repair.c