gentoo-overlay/sys-kernel/hardened-kernel/files/linux-6.12/0058-bcachefs-Fix-unhandled-transaction-restart-in-evacua.patch
Alexander Miroshnichenko ad7c6fc00a
sys-kernel/hardened-kernel: bump v6.12.6
bcachefs patches synced to ca2e7a3de895c703d2cbbd9b63c10d8adfba8228 from master branch

Signed-off-by: Alexander Miroshnichenko <alex@millerson.name>
2024-12-20 17:26:34 +03:00

41 lines
1.4 KiB
Diff

From e17c5f5f191f21665cc9e48cd68d92ef4cc377ef Mon Sep 17 00:00:00 2001
From: Kent Overstreet <kent.overstreet@linux.dev>
Date: Thu, 7 Nov 2024 22:00:05 -0500
Subject: [PATCH 058/233] bcachefs: Fix unhandled transaction restart in
evacuate_bucket()
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
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 <kent.overstreet@linux.dev>
Signed-off-by: Alexander Miroshnichenko <alex@millerson.name>
---
fs/bcachefs/move.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/bcachefs/move.c b/fs/bcachefs/move.c
index d6e68265e039..a6b503278519 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));
}
--
2.45.2