bcachefs: Run bch2_check_fix_ptrs() via triggers
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 7 Apr 2024 23:07:09 +0000 (19:07 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 8 May 2024 21:29:20 +0000 (17:29 -0400)
commitf40d13f94df744185f99732e89bc8d085729ecc9
treef0575c15e130d0b2a0c6ad459efd8d646bcece4a
parent930e1a92d62d3f0dbf8d27002c539819738ef6bb
bcachefs: Run bch2_check_fix_ptrs() via triggers

Currently, the reflink_p gc trigger does repair as well - turning a
reflink_p key into an error key if the reflink_v it points to doesn't
exist.

This won't work with online check/repair, because the repair path once
online will be subject to transaction restarts, but BTREE_TRIGGER_gc is
not idempotant - we can't run it multiple times if we get a transaction
restart.

So we need to split these paths; to do so this patch calls
check_fix_ptrs() by a new general path - a new trigger type,
BTREE_TRIGGER_check_repair.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_cache.c
fs/bcachefs/btree_cache.h
fs/bcachefs/btree_gc.c
fs/bcachefs/btree_types.h
fs/bcachefs/buckets.c
fs/bcachefs/buckets.h
fs/bcachefs/ec.c