]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_repair: fix missing dir buffer corruption checks
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 10 Jul 2020 19:34:36 +0000 (15:34 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Fri, 10 Jul 2020 19:34:36 +0000 (15:34 -0400)
commitbe752639294c8a1eb0f06275e77744f32e5bd277
tree458c7d1ce99f848dd112d47a422e65bb950b4cb6
parenteaa5b0b79bcf2eb36f7a5e1a5b7171ad5ced7bac
xfs_repair: fix missing dir buffer corruption checks

The da_read_buf() function operates in "salvage" mode, which means that
if the verifiers fail, it will return a buffer with b_error set.  The
callers of da_read_buf, however, do not adequately check for verifier
errors, which means that repair can fail to flag a corrupt filesystem.

Fix the callers to do this properly.  The dabtree block walker and the
dabtree path checker functions to complain any time the da node / leafn
verifiers fail.  Fix the directory block walking functions to complain
about EFSCORRUPTED, since they already dealt with EFSBADCRC.

Found by running xfs/496 against lhdr.stale = middlebit.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/da_util.c
repair/dir2.c