summaryrefslogtreecommitdiff
path: root/fs/bcachefs/dirent.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-10-28 23:16:55 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:15 +0300
commit285b181ad460bb240041a9ca7935f9e884040405 (patch)
treeb1c04e61d1e45e10540520dad0ae87511675adb1 /fs/bcachefs/dirent.c
parent6caf05785060b2522f577b000849bbc172efb135 (diff)
downloadlinux-285b181ad460bb240041a9ca7935f9e884040405.tar.xz
bcachefs: Improve transaction restart handling in fsck code
The fsck code has been handling transaction restarts locally, to avoid calling fsck_err() multiple times (and asking the user/logging the error multiple times) on transaction restart. However, with our improving assertions about iterator validity, this isn't working anymore - the code wasn't entirely correct, in ways that are fine for now but are going to matter once we start wanting online fsck. This code converts much of the fsck code to handle transaction restarts in a more rigorously correct way - moving restart handling up to the top level of check_dirent, check_xattr and others - at the cost of logging errors multiple times on transaction restart. Fixing the issues with logging errors multiple times is probably going to require memoizing calls to fsck_err() - we'll leave that for future improvements. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/dirent.c')
-rw-r--r--fs/bcachefs/dirent.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/bcachefs/dirent.c b/fs/bcachefs/dirent.c
index 6be3ec4ec4a6..9267eea810f8 100644
--- a/fs/bcachefs/dirent.c
+++ b/fs/bcachefs/dirent.c
@@ -128,9 +128,7 @@ void bch2_dirent_to_text(struct printbuf *out, struct bch_fs *c,
d.v->d_type != DT_SUBVOL
? le64_to_cpu(d.v->d_inum)
: le32_to_cpu(d.v->d_child_subvol),
- d.v->d_type < BCH_DT_MAX
- ? bch2_d_types[d.v->d_type]
- : "(bad d_type)");
+ bch2_d_type_str(d.v->d_type));
}
static struct bkey_i_dirent *dirent_create_key(struct btree_trans *trans,