Skip to content

Commit 595170d

Browse files
author
Kent Overstreet
committed
bcachefs: Fix marking reflink pointers to missing indirect extents
reflink pointers to missing indirect extents aren't deleted, they just have an error bit set - in case the indirect extent somehow reappears. fsck/mark and sweep thus needs to ignore these errors. Also, they can be marked AUTOFIX now. Reported-by: Roland Vet <vet.roland@protonmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 4be214c commit 595170d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

fs/bcachefs/reflink.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ static s64 gc_trigger_reflink_p_segment(struct btree_trans *trans,
381381
not_found:
382382
if (flags & BTREE_TRIGGER_check_repair) {
383383
ret = bch2_indirect_extent_missing_error(trans, p, *idx, next_idx, false);
384+
if (ret == -BCH_ERR_missing_indirect_extent)
385+
ret = 0;
384386
if (ret)
385387
goto err;
386388
}

fs/bcachefs/sb-errors_format.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ enum bch_fsck_flags {
180180
x(ptr_crc_nonce_mismatch, 162, 0) \
181181
x(ptr_stripe_redundant, 163, 0) \
182182
x(reservation_key_nr_replicas_invalid, 164, 0) \
183-
x(reflink_v_refcount_wrong, 165, 0) \
183+
x(reflink_v_refcount_wrong, 165, FSCK_AUTOFIX) \
184184
x(reflink_v_pos_bad, 292, 0) \
185-
x(reflink_p_to_missing_reflink_v, 166, 0) \
185+
x(reflink_p_to_missing_reflink_v, 166, FSCK_AUTOFIX) \
186186
x(reflink_refcount_underflow, 293, 0) \
187187
x(stripe_pos_bad, 167, 0) \
188188
x(stripe_val_size_bad, 168, 0) \

0 commit comments

Comments
 (0)