]> git.dujemihanovic.xyz Git - linux.git/commitdiff
bcachefs: Create lost+found in correct snapshot
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 28 Sep 2024 19:33:08 +0000 (15:33 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 5 Oct 2024 00:25:31 +0000 (20:25 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fsck.c

index 881ad5b9447fd88d85c83363877ca65b38f21e10..f0d6696c4df6162aeec3d47b8ac01c7aca6af995 100644 (file)
@@ -283,11 +283,17 @@ static int lookup_lostfound(struct btree_trans *trans, u32 snapshot,
        return ret;
 
 create_lostfound:
+       /*
+        * we always create lost+found in the root snapshot; we don't want
+        * different branches of the snapshot tree to have different lost+found
+        */
+       snapshot = le32_to_cpu(st.root_snapshot);
        /*
         * XXX: we could have a nicer log message here  if we had a nice way to
         * walk backpointers to print a path
         */
-       bch_notice(c, "creating lost+found in snapshot %u", le32_to_cpu(st.root_snapshot));
+       bch_notice(c, "creating lost+found in subvol %llu snapshot %u",
+                  root_inum.subvol, le32_to_cpu(st.root_snapshot));
 
        u64 now = bch2_current_time(c);
        struct btree_iter lostfound_iter = { NULL };