[PATCH 4/4] rhashtable: fix vmalloc() deadlock in atomic rehash

Linus Torvalds torvalds at linux-foundation.org
Thu Nov 5 13:02:35 PST 2026


On Thu, 5 Nov 2026 at 10:44, Uladzislau Rezki <urezki at gmail.com> 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



More information about the maple-tree mailing list