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>
touched++;
- if (freed >= nr)
+ if (touched >= nr)
break;
if (!btree_node_reclaim(c, b)) {
list_for_each_entry_safe(b, t, &bc->live, list) {
touched++;
- if (freed >= nr) {
+ if (touched >= nr) {
/* Save position */
if (&t->list != &bc->live)
list_move_tail(&bc->live, &t->list);