Commit 595170d4 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

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: default avatarRoland Vet <vet.roland@protonmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 4be214c2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -381,6 +381,8 @@ static s64 gc_trigger_reflink_p_segment(struct btree_trans *trans,
not_found:
	if (flags & BTREE_TRIGGER_check_repair) {
		ret = bch2_indirect_extent_missing_error(trans, p, *idx, next_idx, false);
		if (ret == -BCH_ERR_missing_indirect_extent)
			ret = 0;
		if (ret)
			goto err;
	}
+2 −2
Original line number Diff line number Diff line
@@ -180,9 +180,9 @@ enum bch_fsck_flags {
	x(ptr_crc_nonce_mismatch,				162,	0)		\
	x(ptr_stripe_redundant,					163,	0)		\
	x(reservation_key_nr_replicas_invalid,			164,	0)		\
	x(reflink_v_refcount_wrong,				165,	0)		\
	x(reflink_v_refcount_wrong,				165,	FSCK_AUTOFIX)	\
	x(reflink_v_pos_bad,					292,	0)		\
	x(reflink_p_to_missing_reflink_v,			166,	0)		\
	x(reflink_p_to_missing_reflink_v,			166,	FSCK_AUTOFIX)	\
	x(reflink_refcount_underflow,				293,	0)		\
	x(stripe_pos_bad,					167,	0)		\
	x(stripe_val_size_bad,					168,	0)		\