summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/reflink.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-02-06 22:28:41 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2025-02-07 14:49:47 -0500
commit595170d4b660640289003d1881a9a6ef8ded6865 (patch)
treeafd9da474f90066f465bfa32bef37ebff2129ed5 /fs/bcachefs/reflink.c
parentbcachefs: bch2_bkey_sectors_need_rebalance() now only depends on bch_extent_r... (diff)
downloadlinux-595170d4b660640289003d1881a9a6ef8ded6865.tar.gz
linux-595170d4b660640289003d1881a9a6ef8ded6865.zip
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>
Diffstat (limited to 'fs/bcachefs/reflink.c')
-rw-r--r--fs/bcachefs/reflink.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/reflink.c b/fs/bcachefs/reflink.c
index 93ba4f4e47ca..376fd0a6e868 100644
--- a/fs/bcachefs/reflink.c
+++ b/fs/bcachefs/reflink.c
@@ -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;
}