Re: [PATCH 4/4] rhashtable: fix vmalloc() deadlock in atomic rehash
From: Linus Torvalds
Date: Thu Nov 05 2026 - 16:03:09 EST
On Thu, 5 Nov 2026 at 10:44, Uladzislau Rezki <urezki@xxxxxxxxx> wrote:
>
> @@ -1025,7 +1025,13 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
> }
> }
> } else {
> - spin_lock(&br->hash_lock);
> + if (in_serving_softirq()) {
> + if (!spin_trylock(&br->hash_lock))
I don't think that in_serving_softirq() makes any sense.
If I read this code correctly - and it's possible I didn't - this is
always called under local_bh_disable().
And local_bh_disable() will have increased the preempt-count exactly
so that it looks like it's in_serving_softirq().
Maybe I got lost somewhere, but it basically looks like that test will
always be true and is pointless (and misleading).
Linus