diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-10-28 16:16:55 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:15 -0400 |
commit | 285b181ad460bb240041a9ca7935f9e884040405 (patch) | |
tree | b1c04e61d1e45e10540520dad0ae87511675adb1 /fs/bcachefs/opts.h | |
parent | 6caf05785060b2522f577b000849bbc172efb135 (diff) |
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/opts.h')
-rw-r--r-- | fs/bcachefs/opts.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/opts.h b/fs/bcachefs/opts.h index c5def5b1f558..4e59bff09578 100644 --- a/fs/bcachefs/opts.h +++ b/fs/bcachefs/opts.h @@ -20,6 +20,11 @@ extern const char * const bch2_cache_replacement_policies[]; extern const char * const bch2_member_states[]; extern const char * const bch2_d_types[]; +static inline const char *bch2_d_type_str(unsigned d_type) +{ + return (d_type < BCH_DT_MAX ? bch2_d_types[d_type] : NULL) ?: "(bad d_type)"; +} + /* * Mount options; we also store defaults in the superblock. * |