]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_repair: invalidate dirhash entry when junking dirent
authorDarrick J. Wong <djwong@kernel.org>
Wed, 28 Jul 2021 23:05:15 +0000 (19:05 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 28 Jul 2021 23:05:15 +0000 (19:05 -0400)
commitf1ea06d0977600a65ace9debc8c56ac1e01aa9a0
treea465ee7a55f92401ffbb5e5cb376aad796f0700a
parent4130bb62c4a510f73b22ff28aa4eef820fe35f67
xfs_repair: invalidate dirhash entry when junking dirent

In longform_dir2_entry_check_data, we add the directory entries we find
to the incore dirent hash table after we've validated the name but
before we're totally done checking the entry.  This sequence is
necessary to detect all duplicated names in the directory.

Unfortunately, if we later decide to junk the ondisk dirent, we neglect
to mark the dirhash entry, so if the directory gets rebuilt, it will get
rebuilt with the entry that we rejected.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/phase6.c