Commit c451986b authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: do reflink_p repair from BTREE_TRIGGER_check_repair

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent f40d13f9
...@@ -164,10 +164,13 @@ static s64 gc_trigger_reflink_p_segment(struct btree_trans *trans, ...@@ -164,10 +164,13 @@ static s64 gc_trigger_reflink_p_segment(struct btree_trans *trans,
BUG_ON((s64) r->refcount + add < 0); BUG_ON((s64) r->refcount + add < 0);
if (flags & BTREE_TRIGGER_gc)
r->refcount += add; r->refcount += add;
*idx = r->offset; *idx = r->offset;
return 0; return 0;
not_found: not_found:
BUG_ON(!(flags & BTREE_TRIGGER_check_repair));
if (fsck_err(c, reflink_p_to_missing_reflink_v, if (fsck_err(c, reflink_p_to_missing_reflink_v,
"pointer to missing indirect extent\n" "pointer to missing indirect extent\n"
" %s\n" " %s\n"
...@@ -216,7 +219,7 @@ static int __trigger_reflink_p(struct btree_trans *trans, ...@@ -216,7 +219,7 @@ static int __trigger_reflink_p(struct btree_trans *trans,
ret = trans_trigger_reflink_p_segment(trans, p, &idx, flags); ret = trans_trigger_reflink_p_segment(trans, p, &idx, flags);
} }
if (flags & BTREE_TRIGGER_gc) { if (flags & (BTREE_TRIGGER_check_repair|BTREE_TRIGGER_gc)) {
size_t l = 0, r = c->reflink_gc_nr; size_t l = 0, r = c->reflink_gc_nr;
while (l < r) { while (l < r) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment