summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-06-26 13:56:21 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:42 -0400
commitc61b7e21ecfff2096cdb84d86bd18f1ceab7de72 (patch)
tree0def6614985c689d652bfad9fde10c989567477c /fs/bcachefs
parent649a9b68ac126fc7c8735892d3f833b620c9cbde (diff)
downloadlinux-stable-c61b7e21ecfff2096cdb84d86bd18f1ceab7de72.tar.gz
linux-stable-c61b7e21ecfff2096cdb84d86bd18f1ceab7de72.tar.bz2
linux-stable-c61b7e21ecfff2096cdb84d86bd18f1ceab7de72.zip
bcachefs: Fix a null ptr deref in bch2_btree_iter_traverse_one()
We use sentinal values that aren't NULL to indicate there's a btree node at a higher level; occasionally, this may result in btree_iter_up_until_good_node() stopping at one of those sentinal values. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r--fs/bcachefs/btree_iter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index 2bd02e804b76..7501556c0988 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -1235,7 +1235,7 @@ static int btree_iter_traverse_one(struct btree_iter *iter)
*
* XXX correctly using BTREE_ITER_UPTODATE should make this unnecessary
*/
- if (btree_iter_node(iter, iter->level)) {
+ if (is_btree_node(iter, iter->level)) {
BUG_ON(!btree_iter_pos_in_node(iter, iter->l[iter->level].b));
btree_iter_advance_to_pos(iter, &iter->l[iter->level], -1);