bcachefs: Prevent a btree iter overflow in alloc path
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 19 Jul 2022 18:51:52 +0000 (14:51 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:36 +0000 (17:09 -0400)
commit90cecb921cfe95858a32995019f11c20b6339607
treef9e0a742780d94949d6d6ae6901682b40a272b92
parentd4bf5eecd78a90d019b933929a14c91d6d41af62
bcachefs: Prevent a btree iter overflow in alloc path

In bch2_bucket_alloc_trans(), we're iterating over buckets - but not
directly with an iterator, since we're iterating over the freespace
btree.

This means that we need to clear iter->path->preserve, otherwise we'll
end up retaining a btree_path for every alloc key we touched - which is
not what we want here.

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