bcachefs: Improved check_directory_structure()
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 7 Apr 2021 07:11:07 +0000 (03:11 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:00 +0000 (17:09 -0400)
commitd3ff7fec9c604e2cac3d0126f6764c5c0392a271
tree652277adf8c1b6c6a1a9984d4ec9e9a3ca1d38ef
parent176cf4bf59014d03be6cef33cabb677d2117dbb2
bcachefs: Improved check_directory_structure()

Now that we have inode backpointers, we can simplify checking directory
structure: instead of doing a DFS from the filesystem root and then
checking if we found everything, we can iterate over every inode and see
if we can go up until we get to the root.

This patch also has a number of fixes and simplifications for the inode
backpointer checks. Also, it turns out we don't actually need the
BCH_INODE_BACKPTR_UNTRUSTED flag.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_update.h
fs/bcachefs/fs-common.c
fs/bcachefs/fsck.c
fs/bcachefs/inode.c
fs/bcachefs/inode.h