Skip to content

Commit dc53718

Browse files
author
Kent Overstreet
committed
bcachefs: Fix validate_bset() repair path
When we truncate a bset (due to it extending past the end of the btree node), we can't skip the rest of the validation for e.g. the packed format (if it's the first bset in the node). Reported-by: [email protected] Signed-off-by: Kent Overstreet <[email protected]>
1 parent f8f1dde commit dc53718

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

fs/bcachefs/btree_io.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -733,11 +733,8 @@ static int validate_bset(struct bch_fs *c, struct bch_dev *ca,
733733
c, ca, b, i, NULL,
734734
bset_past_end_of_btree_node,
735735
"bset past end of btree node (offset %u len %u but written %zu)",
736-
offset, sectors, ptr_written ?: btree_sectors(c))) {
736+
offset, sectors, ptr_written ?: btree_sectors(c)))
737737
i->u64s = 0;
738-
ret = 0;
739-
goto out;
740-
}
741738

742739
btree_err_on(offset && !i->u64s,
743740
-BCH_ERR_btree_node_read_err_fixable,
@@ -829,7 +826,6 @@ static int validate_bset(struct bch_fs *c, struct bch_dev *ca,
829826
BSET_BIG_ENDIAN(i), write,
830827
&bn->format);
831828
}
832-
out:
833829
fsck_err:
834830
printbuf_exit(&buf2);
835831
printbuf_exit(&buf1);

0 commit comments

Comments
 (0)