On Tue, Mar 10, 2020 at 05:48:20PM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > In xchk_dir_check_ftype, we should mark the directory corrupt if we try > to _iget a directory entry's inode pointer and the inode btree says the > inode is not allocated. This involves changing the IGET call to force > the inobt lookup to return EINVAL if the inode isn't allocated; and > rearranging the code so that we always perform the iget. > > We can also remove the !hasftype code from the function, because any > DT_ flags we encounter on those filesystems were synthesized in core, > not read in from disk. > > Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > --- > fs/xfs/scrub/dir.c | 39 ++++++++++++++++++++++----------------- > 1 file changed, 22 insertions(+), 17 deletions(-) That's much neater. Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx> -- Dave Chinner david@xxxxxxxxxxxxx