bcachefs: Fix check_pos_snapshot_overwritten for !snapshots
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 6 Jan 2022 05:04:56 +0000 (00:04 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:22 +0000 (17:09 -0400)
It shouldn't run if the btree being checked doesn't have snapshots.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/btree_update_leaf.c

index 24de8604740ce68acf8518f3ff945c2947d4d459..c29815e6183d9c1ab4734215f7cb5e48834f66a4 100644 (file)
@@ -1088,6 +1088,9 @@ static int check_pos_snapshot_overwritten(struct btree_trans *trans,
        struct bkey_s_c k;
        int ret;
 
+       if (!btree_type_has_snapshots(id))
+               return 0;
+
        if (!snapshot_t(c, pos.snapshot)->children[0])
                return 0;