summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-03-30 06:00:50 +0100
committerKent Overstreet <kent.overstreet@linux.dev>2024-04-01 07:05:50 +0200
commiteab3a3ce2dea1a4013a3a553722b85f55a76ac2d (patch)
treeaf59eb2286c8fad839ca8629e8ed8299ec0349d4 /fs/bcachefs
parentbcachefs: Fix remove_dirent() (diff)
downloadlinux-eab3a3ce2dea1a4013a3a553722b85f55a76ac2d.tar.xz
linux-eab3a3ce2dea1a4013a3a553722b85f55a76ac2d.zip
bcachefs: Fix overlapping extent repair
overlapping extent repair was colliding with extent past end of inode checks - don't update "extent ends at" until we know we have an extent. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r--fs/bcachefs/fsck.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c
index 0a47b0a473d8..cbb8b43e419f 100644
--- a/fs/bcachefs/fsck.c
+++ b/fs/bcachefs/fsck.c
@@ -1372,10 +1372,6 @@ static int check_overlapping_extents(struct btree_trans *trans,
goto err;
}
- ret = extent_ends_at(c, extent_ends, seen, k);
- if (ret)
- goto err;
-
extent_ends->last_pos = k.k->p;
err:
return ret;
@@ -1505,6 +1501,12 @@ static int check_extent(struct btree_trans *trans, struct btree_iter *iter,
i->seen_this_pos = true;
}
+
+ if (k.k->type != KEY_TYPE_whiteout) {
+ ret = extent_ends_at(c, extent_ends, s, k);
+ if (ret)
+ goto err;
+ }
out:
err:
fsck_err: