]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: check directory bestfree information in the verifier
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 3 Jun 2018 23:10:13 +0000 (16:10 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 5 Jun 2018 01:25:04 +0000 (18:25 -0700)
commitb9ffacf907444fa05f438b7184e269f5697dab1b
tree1377fb33c226a3c230e1f51e638fcf6edb8c089c
parent95e3750820892ff08257bddf3ea8d9e64817ba75
xfs: check directory bestfree information in the verifier

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>
fs/xfs/libxfs/xfs_dir2_data.c