Skip to content

Commit 28aa859

Browse files
author
Kent Overstreet
committed
bcachefs: kmsan asserts
Catching these early makes them a lot easier to track down. Signed-off-by: Kent Overstreet <[email protected]>
1 parent 53cf2a3 commit 28aa859

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

fs/bcachefs/btree_trans_commit.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ bool bch2_btree_bset_insert_key(struct btree_trans *trans,
164164
EBUG_ON(bpos_gt(insert->k.p, b->data->max_key));
165165
EBUG_ON(insert->k.u64s > bch2_btree_keys_u64s_remaining(b));
166166
EBUG_ON(!b->c.level && !bpos_eq(insert->k.p, path->pos));
167+
kmsan_check_memory(insert, bkey_bytes(&insert->k));
167168

168169
k = bch2_btree_node_iter_peek_all(node_iter, b);
169170
if (k && bkey_cmp_left_packed(b, k, &insert->k.p))

fs/bcachefs/btree_update.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ static noinline int bch2_trans_update_get_key_cache(struct btree_trans *trans,
512512
int __must_check bch2_trans_update(struct btree_trans *trans, struct btree_iter *iter,
513513
struct bkey_i *k, enum btree_iter_update_trigger_flags flags)
514514
{
515+
kmsan_check_memory(k, bkey_bytes(&k->k));
516+
515517
btree_path_idx_t path_idx = iter->update_path ?: iter->path;
516518
int ret;
517519

fs/bcachefs/btree_update.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ static inline int __must_check bch2_trans_update_buffered(struct btree_trans *tr
133133
enum btree_id btree,
134134
struct bkey_i *k)
135135
{
136+
kmsan_check_memory(k, bkey_bytes(&k->k));
137+
136138
if (unlikely(!btree_type_uses_write_buffer(btree))) {
137139
int ret = bch2_btree_write_buffer_insert_err(trans, btree, k);
138140
dump_stack();

0 commit comments

Comments
 (0)