gentoo-overlay/sys-kernel/hardened-kernel/files/linux-6.12/0007-bcachefs-rcu_pending-d...

37 lines
1.2 KiB
Diff

From 1ef7af68e376ab89a6b8e49387f7a4bad4fc6657 Mon Sep 17 00:00:00 2001
From: Kent Overstreet <kent.overstreet@linux.dev>
Date: Sun, 22 Sep 2024 01:11:36 -0400
Subject: [PATCH 007/233] bcachefs: rcu_pending: don't invoke __call_rcu()
under lock
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
In userspace we don't (yet) have an SRCU implementation, so call_srcu()
recurses.
But we don't want to be invoking it under the lock anyways.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Signed-off-by: Alexander Miroshnichenko <alex@millerson.name>
---
fs/bcachefs/rcu_pending.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/bcachefs/rcu_pending.c b/fs/bcachefs/rcu_pending.c
index 40a20192eee8..67522aa344a7 100644
--- a/fs/bcachefs/rcu_pending.c
+++ b/fs/bcachefs/rcu_pending.c
@@ -478,7 +478,9 @@ __rcu_pending_enqueue(struct rcu_pending *pending, struct rcu_head *head,
*/
if (!p->cb_armed) {
p->cb_armed = true;
+ spin_unlock_irqrestore(&p->lock, flags);
__call_rcu(pending->srcu, &p->cb, rcu_pending_rcu_cb);
+ goto free_node;
} else {
__start_poll_synchronize_rcu(pending->srcu);
}
--
2.45.2