diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-04-01 17:14:14 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:38 -0400 |
commit | 0329b1507d37c8a7f87dace9ad888cc5abb7c8a8 (patch) | |
tree | f2e243d92ac4f0223dc48f2c1cafa9fd8b3f754a /fs/bcachefs/btree_iter.c | |
parent | 283eda5798bc5f4f593817e057c14f02790e5bdb (diff) | |
download | lwn-0329b1507d37c8a7f87dace9ad888cc5abb7c8a8.tar.gz lwn-0329b1507d37c8a7f87dace9ad888cc5abb7c8a8.zip |
bcachefs: Trace where btree iterators are allocated
This will help with iterator overflow bugs.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_iter.c')
-rw-r--r-- | fs/bcachefs/btree_iter.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c index 4ce6a66edcd5..7b12bd163df7 100644 --- a/fs/bcachefs/btree_iter.c +++ b/fs/bcachefs/btree_iter.c @@ -1912,13 +1912,14 @@ static struct btree_iter *btree_trans_iter_alloc(struct btree_trans *trans) struct btree_iter *iter; trans_for_each_iter(trans, iter) { - pr_err("iter: btree %s pos %llu:%llu%s%s%s", + pr_err("iter: btree %s pos %llu:%llu%s%s%s %pf", bch2_btree_ids[iter->btree_id], iter->pos.inode, iter->pos.offset, (trans->iters_live & (1ULL << iter->idx)) ? " live" : "", (trans->iters_touched & (1ULL << iter->idx)) ? " touched" : "", - iter->flags & BTREE_ITER_KEEP_UNTIL_COMMIT ? " keep" : ""); + iter->flags & BTREE_ITER_KEEP_UNTIL_COMMIT ? " keep" : "", + (void *) iter->ip_allocated); } panic("trans iter oveflow\n"); @@ -2025,9 +2026,9 @@ static struct btree_iter *__btree_trans_get_iter(struct btree_trans *trans, return iter; } -struct btree_iter *bch2_trans_get_iter(struct btree_trans *trans, - enum btree_id btree_id, - struct bpos pos, unsigned flags) +struct btree_iter *__bch2_trans_get_iter(struct btree_trans *trans, + enum btree_id btree_id, + struct bpos pos, unsigned flags) { struct btree_iter *iter = __btree_trans_get_iter(trans, btree_id, pos, flags); @@ -2064,7 +2065,7 @@ struct btree_iter *bch2_trans_get_node_iter(struct btree_trans *trans, return iter; } -struct btree_iter *bch2_trans_copy_iter(struct btree_trans *trans, +struct btree_iter *__bch2_trans_copy_iter(struct btree_trans *trans, struct btree_iter *src) { struct btree_iter *iter; |