summaryrefslogtreecommitdiff
path: root/libbcachefs/alloc_background.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-07-11 23:07:34 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2022-07-11 23:07:34 -0400
commitdce1de5426edaeca8350810f8707eafdb4dd36c2 (patch)
tree9850b8a7be8482c13c4a076e85739c85ef232849 /libbcachefs/alloc_background.c
parenta29cb4b9f88af9905c0ab9497330eac64456dfdd (diff)
Update bcachefs sources to a059319fee bcachefs: Put some repair messages behind opts->verbose
Diffstat (limited to 'libbcachefs/alloc_background.c')
-rw-r--r--libbcachefs/alloc_background.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/libbcachefs/alloc_background.c b/libbcachefs/alloc_background.c
index 73856717..4b38fbd9 100644
--- a/libbcachefs/alloc_background.c
+++ b/libbcachefs/alloc_background.c
@@ -731,12 +731,13 @@ static int bch2_check_alloc_key(struct btree_trans *trans,
if (ret)
goto err;
- if (fsck_err_on(k.k->type != discard_key_type, c,
- "incorrect key in need_discard btree (got %s should be %s)\n"
- " %s",
- bch2_bkey_types[k.k->type],
- bch2_bkey_types[discard_key_type],
- (bch2_bkey_val_to_text(&buf, c, alloc_k), buf.buf))) {
+ if (k.k->type != discard_key_type &&
+ (c->opts.reconstruct_alloc ||
+ fsck_err(c, "incorrect key in need_discard btree (got %s should be %s)\n"
+ " %s",
+ bch2_bkey_types[k.k->type],
+ bch2_bkey_types[discard_key_type],
+ (bch2_bkey_val_to_text(&buf, c, alloc_k), buf.buf)))) {
struct bkey_i *update =
bch2_trans_kmalloc(trans, sizeof(*update));
@@ -758,13 +759,14 @@ static int bch2_check_alloc_key(struct btree_trans *trans,
if (ret)
goto err;
- if (fsck_err_on(k.k->type != freespace_key_type, c,
- "incorrect key in freespace btree (got %s should be %s)\n"
- " %s",
- bch2_bkey_types[k.k->type],
- bch2_bkey_types[freespace_key_type],
- (printbuf_reset(&buf),
- bch2_bkey_val_to_text(&buf, c, alloc_k), buf.buf))) {
+ if (k.k->type != freespace_key_type &&
+ (c->opts.reconstruct_alloc ||
+ fsck_err(c, "incorrect key in freespace btree (got %s should be %s)\n"
+ " %s",
+ bch2_bkey_types[k.k->type],
+ bch2_bkey_types[freespace_key_type],
+ (printbuf_reset(&buf),
+ bch2_bkey_val_to_text(&buf, c, alloc_k), buf.buf)))) {
struct bkey_i *update =
bch2_trans_kmalloc(trans, sizeof(*update));