bcachefs: check_path() now only needs to walk up to subvolume root
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 16 Feb 2024 04:59:05 +0000 (23:59 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 14 Mar 2024 01:22:25 +0000 (21:22 -0400)
Now that checking subvolume structure is a separate pass, the main
check_directory_connectivity() pass only needs to walk up to a given
inode's subvolume root.

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

index 388f181eb0f2e626312a604d09b369527b462030..f48033be3f6b1fda3da6105b982403b607158c32 100644 (file)
@@ -2247,7 +2247,8 @@ static bool path_is_dup(pathbuf *p, u64 inum, u32 snapshot)
 }
 
 /*
- * Check that a given inode is reachable from the root:
+ * Check that a given inode is reachable from its subvolume root - we already
+ * verified subvolume connectivity:
  *
  * XXX: we should also be verifying that inodes are in the right subvolumes
  */
@@ -2264,8 +2265,7 @@ static int check_path(struct btree_trans *trans, pathbuf *p, struct bkey_s_c ino
 
        BUG_ON(bch2_inode_unpack(inode_k, &inode));
 
-       while (!(inode.bi_inum == BCACHEFS_ROOT_INO &&
-                inode.bi_subvol == BCACHEFS_ROOT_SUBVOL)) {
+       while (!inode.bi_subvol) {
                struct btree_iter dirent_iter;
                struct bkey_s_c_dirent d;
                u32 parent_snapshot = snapshot;