bcachefs: Improve some fsck error messages
authorKent Overstreet <kent.overstreet@gmail.com>
Sat, 16 Apr 2022 22:59:58 +0000 (18:59 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:31 +0000 (17:09 -0400)
We have string names for d_type; use it.

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

index cf9e6f595d539c7b7ce266d587caffdb9c72ea11..d507b9fdd32e9b76f0a2b94bf3beeaf7435e1dad 100644 (file)
@@ -1405,8 +1405,8 @@ static int check_dirent_target(struct btree_trans *trans,
 
                if (fsck_err_on(backpointer_exists &&
                                !target->bi_nlink, c,
-                               "inode %llu has multiple links but i_nlink 0",
-                               target->bi_inum)) {
+                               "inode %llu type %s has multiple links but i_nlink 0",
+                               target->bi_inum, bch2_d_types[d.v->d_type])) {
                        target->bi_nlink++;
                        target->bi_flags &= ~BCH_INODE_UNLINKED;
 
@@ -2254,8 +2254,8 @@ static int check_nlinks_update_hardlinks(struct bch_fs *c,
                }
 
                if (fsck_err_on(bch2_inode_nlink_get(&u) != link->count, c,
-                               "inode %llu has wrong i_nlink (type %u i_nlink %u, should be %u)",
-                               u.bi_inum, mode_to_type(u.bi_mode),
+                               "inode %llu type %s has wrong i_nlink (%u, should be %u)",
+                               u.bi_inum, bch2_d_types[mode_to_type(u.bi_mode)],
                                bch2_inode_nlink_get(&u), link->count)) {
                        bch2_inode_nlink_set(&u, link->count);