From: Kent Overstreet Date: Tue, 14 Mar 2023 15:48:07 +0000 (-0400) Subject: bcachefs: Fix an assert in copygc thread shutdown path X-Git-Tag: io_uring-6.7-2023-11-10~119^2~418 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=c639c29ce6882f4f77a81d778ef4741d5a5979d9;p=linux-block.git bcachefs: Fix an assert in copygc thread shutdown path We're not supposed to have nested (locked) btree_trans on the stack: this means copygc shutdown needs to exit our btree_trans before exiting the move_ctxt, which calls bch2_write(). Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c index 4d8d013fe4fc..4762594f6287 100644 --- a/fs/bcachefs/movinggc.c +++ b/fs/bcachefs/movinggc.c @@ -334,8 +334,8 @@ static int bch2_copygc_thread(void *arg) wake_up(&c->copygc_running_wq); } - bch2_moving_ctxt_exit(&ctxt); bch2_trans_exit(&trans); + bch2_moving_ctxt_exit(&ctxt); free_fifo(&move_buckets); return 0;