]> Git Repo - linux.git/commitdiff
bcachefs: Fix validate_bset() repair path
authorKent Overstreet <[email protected]>
Fri, 8 Nov 2024 05:00:19 +0000 (00:00 -0500)
committerKent Overstreet <[email protected]>
Fri, 8 Nov 2024 19:07:11 +0000 (14:07 -0500)
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]>
fs/bcachefs/btree_io.c

index 6296a11ccb09023a7940b3a80cef5532d5caaf6c..839d68802e4268ff500af0ee6b0029dcf77d3313 100644 (file)
@@ -733,11 +733,8 @@ static int validate_bset(struct bch_fs *c, struct bch_dev *ca,
                         c, ca, b, i, NULL,
                         bset_past_end_of_btree_node,
                         "bset past end of btree node (offset %u len %u but written %zu)",
-                        offset, sectors, ptr_written ?: btree_sectors(c))) {
+                        offset, sectors, ptr_written ?: btree_sectors(c)))
                i->u64s = 0;
-               ret = 0;
-               goto out;
-       }
 
        btree_err_on(offset && !i->u64s,
                     -BCH_ERR_btree_node_read_err_fixable,
@@ -829,7 +826,6 @@ static int validate_bset(struct bch_fs *c, struct bch_dev *ca,
                               BSET_BIG_ENDIAN(i), write,
                               &bn->format);
        }
-out:
 fsck_err:
        printbuf_exit(&buf2);
        printbuf_exit(&buf1);
This page took 0.056656 seconds and 4 git commands to generate.