From: Kent Overstreet Date: Fri, 8 Nov 2024 03:00:05 +0000 (-0500) Subject: bcachefs: Fix unhandled transaction restart in evacuate_bucket() X-Git-Tag: v6.14-rc1~204^2~210 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=69785001c669e6e8681efdc3e49afee9f6a38559;p=thirdparty%2Fkernel%2Flinux.git bcachefs: Fix unhandled transaction restart in evacuate_bucket() Generally, releasing a transaction within a transaction restart means an unhandled transaction restart: but this can happen legitimately within the move code, e.g. when bch2_move_ratelimit() tells us to exit before we've retried. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/move.c b/fs/bcachefs/move.c index d6e68265e0396..a6b5032785190 100644 --- a/fs/bcachefs/move.c +++ b/fs/bcachefs/move.c @@ -197,6 +197,13 @@ void bch2_moving_ctxt_exit(struct moving_context *ctxt) list_del(&ctxt->list); mutex_unlock(&c->moving_context_lock); + /* + * Generally, releasing a transaction within a transaction restart means + * an unhandled transaction restart: but this can happen legitimately + * within the move code, e.g. when bch2_move_ratelimit() tells us to + * exit before we've retried + */ + bch2_trans_begin(ctxt->trans); bch2_trans_put(ctxt->trans); memset(ctxt, 0, sizeof(*ctxt)); }