xfs: always check the existence of a dirent's child inode
authorDarrick J. Wong <djwong@kernel.org>
Wed, 12 Apr 2023 02:00:18 +0000 (19:00 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 12 Apr 2023 02:00:18 +0000 (19:00 -0700)
commit6bb9209ceebb07fd07cec25af04eed1809c654de
treeba404918e618d7c3ffecee6b808bcb6a6eea20b3
parentd9a94480f978d5fbf1235a12a476f9f39a029ea5
xfs: always check the existence of a dirent's child inode

When we're scrubbing directory entries, we always need to iget the child
inode to make sure that the inode pointer points to a valid inode.  The
original directory scrub code (commit a5c4) only set us up to do this
for ftype=1 filesystems, which is not sufficient; and then commit 4b80
made it worse by exempting the dot and dotdot entries.

Sorta-fixes: a5c46e5e8912 ("xfs: scrub directory metadata")
Sorta-fixes: 4b80ac64450f ("xfs: scrub should mark a directory corrupt if any entries cannot be iget'd")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/scrub/dir.c