bcachefs: Fix nested transaction restart handling in bch2_bucket_gens_init()
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 18 Mar 2024 00:32:36 +0000 (20:32 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 18 Mar 2024 00:53:12 +0000 (20:53 -0400)
commit1ba6f48f092ec10df991cae237c9f9b8981938b2
tree8d8bf504fcf9b2673bea66b619678db70c524265
parent3becdd4850094ff87193b0b789570daa525e6506
bcachefs: Fix nested transaction restart handling in bch2_bucket_gens_init()

Nested transaction restart handling is typically best avoided; when the
inner context handles a transaction restart it invalidates the outer
transaction context, so we need to make sure to return a
transaction_restart_nested error.

This code wasn't doing that, and hit the assertion in
for_each_btree_key() that checks for that via trans->restart_count.

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