summaryrefslogtreecommitdiff
path: root/fs/bcachefs/error.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-10-28 21:27:23 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-12-21 01:36:17 -0500
commiteb73e7773fd665c6b2f26e8b5057197ad6794f50 (patch)
tree372d3662038fbd9c020afdc6f235d2178cf05493 /fs/bcachefs/error.c
parent79c5e3c7934cb1358ae403d8a9e4bf84c2195581 (diff)
bcachefs: Kill FSCK_NEED_FSCK
If we find an error that indicates that we need to run fsck, we can specify that directly with run_explicit_recovery_pass(). These are now log_fsck_err() calls: we're just logging in the superblock that an error occurred - and possibly doing an emergency shutdown, depending on policy. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/error.c')
-rw-r--r--fs/bcachefs/error.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/fs/bcachefs/error.c b/fs/bcachefs/error.c
index b679def8fb98..22b0fa405a39 100644
--- a/fs/bcachefs/error.c
+++ b/fs/bcachefs/error.c
@@ -385,9 +385,7 @@ int __bch2_fsck_err(struct bch_fs *c,
prt_str(out, ", not ");
prt_actioning(out, action);
}
- } else if (flags & FSCK_NEED_FSCK) {
- prt_str(out, " (run fsck to correct)");
- } else {
+ } else if (!(flags & FSCK_CAN_IGNORE)) {
prt_str(out, " (repair unimplemented)");
}
@@ -424,11 +422,18 @@ int __bch2_fsck_err(struct bch_fs *c,
if (inconsistent)
bch2_inconsistent_error(c);
- if (ret == -BCH_ERR_fsck_fix) {
- set_bit(BCH_FS_errors_fixed, &c->flags);
- } else {
- set_bit(BCH_FS_errors_not_fixed, &c->flags);
- set_bit(BCH_FS_error, &c->flags);
+ /*
+ * We don't yet track whether the filesystem currently has errors, for
+ * log_fsck_err()s: that would require us to track for every error type
+ * which recovery pass corrects it, to get the fsck exit status correct:
+ */
+ if (flags & FSCK_CAN_FIX) {
+ if (ret == -BCH_ERR_fsck_fix) {
+ set_bit(BCH_FS_errors_fixed, &c->flags);
+ } else {
+ set_bit(BCH_FS_errors_not_fixed, &c->flags);
+ set_bit(BCH_FS_error, &c->flags);
+ }
}
err:
if (action != action_orig)