]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bcachefs: fsck: additional diagnostics for reattach_inode()
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 16 Jun 2025 20:14:59 +0000 (16:14 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 16 Jun 2025 23:05:02 +0000 (19:05 -0400)
Log the inode's new path.

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

index 7414a16af99092ee99f0caf363c4856cde8d8db5..f2c8e904acab2bbb6cc5b5f861b3318f2fca1b30 100644 (file)
@@ -399,6 +399,8 @@ static int reattach_inode(struct btree_trans *trans, struct bch_inode_unpacked *
        if (ret)
                return ret;
 
+       bch_verbose(c, "got lostfound inum %llu", lostfound.bi_inum);
+
        lostfound.bi_nlink += S_ISDIR(inode->bi_mode);
 
        /* ensure lost+found inode is also present in inode snapshot */
@@ -435,6 +437,16 @@ static int reattach_inode(struct btree_trans *trans, struct bch_inode_unpacked *
        if (ret)
                return ret;
 
+       {
+               CLASS(printbuf, buf)();
+               ret = bch2_inum_snapshot_to_path(trans, inode->bi_inum,
+                                                inode->bi_snapshot, NULL, &buf);
+               if (ret)
+                       return ret;
+
+               bch_info(c, "reattached at %s", buf.buf);
+       }
+
        /*
         * Fix up inodes in child snapshots: if they should also be reattached
         * update the backpointer field, if they should not be we need to emit