]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bcachefs: fsck: Fix check_directory_structure when no check_dirents
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 17 Jun 2025 17:08:35 +0000 (13:08 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Tue, 17 Jun 2025 17:35:19 +0000 (13:35 -0400)
commitbbc3a0b17a890aa19bddd0f9b08e8af488f1ec94
tree5cdcbcad12bd2f32dba0877d7321ecf75432d470
parente1f0e1a45a40f45ed615abf938cbdfeb7793a9ee
bcachefs: fsck: Fix check_directory_structure when no check_dirents

check_directory_structure runs after check_dirents, so it expects that
it won't see any inodes with missing backpointers - normally.

But online fsck can't run check_dirents yet, or the user might only be
running a specific pass, so we need to be careful that this isn't an
error. If an inode is unreachable, that's handled by a separate pass.

Also, add a new 'bch2_inode_has_backpointer()' helper, since we were
doing this inconsistently.

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