percpu_down_write(&c->mark_lock);
bch2_gc_free(c);
percpu_up_write(&c->mark_lock);
+ /* flush fsck errors, reset counters */
+ bch2_flush_fsck_errs(c);
goto again;
}
#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);
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);
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);
ret = 0;
err:
fsck_err:
+ set_bit(BCH_FS_FSCK_DONE, &c->flags);
bch2_flush_fsck_errs(c);
+
journal_keys_free(&journal_keys);
journal_entries_free(&journal_entries);
kfree(clean);