diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-03-28 08:28:59 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:08:19 +0200 |
commit | 6543f5620d81cfa7b52d00c7ade0f037beb7a71e (patch) | |
tree | ef10c47e7c4bce5bd79790c2fe88eff5f41ebaae /fs/bcachefs/error.c | |
parent | bcachefs: simplify gc locking a bit (diff) | |
download | linux-6543f5620d81cfa7b52d00c7ade0f037beb7a71e.tar.xz linux-6543f5620d81cfa7b52d00c7ade0f037beb7a71e.zip |
bcachefs: Handle fsck errors at runtime better
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/error.c')
-rw-r--r-- | fs/bcachefs/error.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/bcachefs/error.c b/fs/bcachefs/error.c index 08e79166dae4..f0a44101b7e7 100644 --- a/fs/bcachefs/error.c +++ b/fs/bcachefs/error.c @@ -67,10 +67,20 @@ enum fsck_err_ret bch2_fsck_err(struct bch_fs *c, unsigned flags, bool fix = false, print = true, suppressing = false; char _buf[sizeof(s->buf)], *buf = _buf; - mutex_lock(&c->fsck_error_lock); + if (test_bit(BCH_FS_FSCK_DONE, &c->flags)) { + va_start(args, fmt); + vprintk(fmt, args); + va_end(args); - if (test_bit(BCH_FS_FSCK_DONE, &c->flags)) - goto print; + if (c->opts.errors == BCH_ON_ERROR_CONTINUE && + flags & FSCK_CAN_FIX) + return FSCK_ERR_FIX; + + bch2_inconsistent_error(c); + return FSCK_ERR_EXIT; + } + + mutex_lock(&c->fsck_error_lock); list_for_each_entry(s, &c->fsck_errors, list) if (s->fmt == fmt) |