bcachefs: Fix infinite loop in bch2_btree_cache_scan()
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 11 Nov 2021 20:50:22 +0000 (15:50 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:16 +0000 (17:09 -0400)
commit54b2db3d58eadb4496a671d43b1e7c0506dd0220
treed1bce98e69a4187a3708c9b49f229de01a661c5e
parentf74a5051b0e58a8f4fab26a2fc65b95ee17df7a0
bcachefs: Fix infinite loop in bch2_btree_cache_scan()

When attempting to free btree nodes, we might not be able to free all
the nodes that were requested. But the code was looping until it had
freed _all_ the nodes requested, when it should have only been
attempting to free nr nodes.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_cache.c