xfs: walk directory parent pointers to determine backref count
authorDarrick J. Wong <djwong@kernel.org>
Mon, 22 Apr 2024 16:48:05 +0000 (09:48 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 23 Apr 2024 14:47:03 +0000 (07:47 -0700)
commit77ede5f44b0d86c2ec812442846f512884009766
tree3eb3b5850649190c24320581f76395620873935f
parent8ad345306d1eba337a3b88f9acbe762f9e770f76
xfs: walk directory parent pointers to determine backref count

If the filesystem has parent pointers enabled, walk the parent pointers
of subdirectories to determine the true backref count.  In theory each
subdir should have a single parent reachable via dotdot, but in the case
of (corrupt) subdirs with multiple parents, we need to keep the link
counts high enough that the directory loop detector will be able to
correct the multiple parents problems.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/common.h
fs/xfs/scrub/nlinks.c
fs/xfs/scrub/nlinks_repair.c
fs/xfs/scrub/parent.c
fs/xfs/scrub/trace.c
fs/xfs/scrub/trace.h