diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-09-07 12:42:27 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:26 -0400 |
commit | 89b0511826c1bde65f57a2e051ee9fcb274bff69 (patch) | |
tree | b6c7e5c5a635005e01c8022b78c3d4284223a494 /fs/bcachefs/error.c | |
parent | 5055b50939843c027e1cf4602316035d9f21f032 (diff) |
bcachefs: Flush fsck errors when looping in btree gc
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/error.c')
-rw-r--r-- | fs/bcachefs/error.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/bcachefs/error.c b/fs/bcachefs/error.c index 1aaff44e18cf..304ff92500be 100644 --- a/fs/bcachefs/error.c +++ b/fs/bcachefs/error.c @@ -4,6 +4,8 @@ #include "io.h" #include "super.h" +#define FSCK_ERR_RATELIMIT_NR 10 + bool bch2_inconsistent_error(struct bch_fs *c) { set_bit(BCH_FS_ERROR, &c->flags); @@ -97,8 +99,8 @@ enum fsck_err_ret bch2_fsck_err(struct bch_fs *c, unsigned flags, found: list_move(&s->list, &c->fsck_errors); s->nr++; - suppressing = s->nr == 10; - print = s->nr <= 10; + suppressing = s->nr == FSCK_ERR_RATELIMIT_NR; + print = s->nr <= FSCK_ERR_RATELIMIT_NR; buf = s->buf; print: va_start(args, fmt); @@ -152,10 +154,9 @@ void bch2_flush_fsck_errs(struct bch_fs *c) struct fsck_err_state *s, *n; mutex_lock(&c->fsck_error_lock); - set_bit(BCH_FS_FSCK_DONE, &c->flags); list_for_each_entry_safe(s, n, &c->fsck_errors, list) { - if (s->nr > 10) + if (s->nr > FSCK_ERR_RATELIMIT_NR) bch_err(c, "Saw %llu errors like:\n %s", s->nr, s->buf); list_del(&s->list); |