From: Kent Overstreet Date: Thu, 6 Jan 2022 05:04:56 +0000 (-0500) Subject: bcachefs: Fix check_pos_snapshot_overwritten for !snapshots X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a74313481ae24cd301b79b5fca3161079e739a21;p=linux.git bcachefs: Fix check_pos_snapshot_overwritten for !snapshots It shouldn't run if the btree being checked doesn't have snapshots. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c index 24de8604740ce..c29815e6183d9 100644 --- a/fs/bcachefs/btree_update_leaf.c +++ b/fs/bcachefs/btree_update_leaf.c @@ -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;