]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: check directory bestfree information in the verifier
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 28 Jun 2018 20:11:58 +0000 (15:11 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 28 Jun 2018 20:11:58 +0000 (15:11 -0500)
commit280f5adef5e6da98abe4319fa1a2518ed4be7e92
tree46a4ebb0c543f1a7741e3cffa7e93a6c5b4d07e8
parent52581d38d832b4345aeaa1b68284fffab073b42a
xfs: check directory bestfree information in the verifier

Source kernel commit: e4f45eff86fdbafd8e0ba072fd52422e32e5b5ac

Create a variant of xfs_dir2_data_freefind that is suitable for use in a
verifier.  Because _freefind is called by the verifier, we simply
duplicate the _freefind function, convert the ASSERTs to return
__this_address, and modify the verifier to call our new function.  Once
we've made it impossible for directory blocks with bad bestfree data to
make it into the filesystem we can remove the DEBUG code from the
regular _freefind function.

Underlying argument: corruption of on-disk metadata should return
-EFSCORRUPTED instead of blowing ASSERTs.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_dir2_data.c