Skip to content

Commit eab3a3c

Browse files
author
Kent Overstreet
committed
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 <[email protected]>
1 parent 8ce1db8 commit eab3a3c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

fs/bcachefs/fsck.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,10 +1372,6 @@ static int check_overlapping_extents(struct btree_trans *trans,
13721372
goto err;
13731373
}
13741374

1375-
ret = extent_ends_at(c, extent_ends, seen, k);
1376-
if (ret)
1377-
goto err;
1378-
13791375
extent_ends->last_pos = k.k->p;
13801376
err:
13811377
return ret;
@@ -1505,6 +1501,12 @@ static int check_extent(struct btree_trans *trans, struct btree_iter *iter,
15051501

15061502
i->seen_this_pos = true;
15071503
}
1504+
1505+
if (k.k->type != KEY_TYPE_whiteout) {
1506+
ret = extent_ends_at(c, extent_ends, s, k);
1507+
if (ret)
1508+
goto err;
1509+
}
15081510
out:
15091511
err:
15101512
fsck_err:

0 commit comments

Comments
 (0)