phonet: Convert phonet_device_list.lock to spinlock_t.

addr_doit() calls phonet_address_add() or phonet_address_del()
for RTM_NEWADDR or RTM_DELADDR, respectively.

Both functions only touch phonet_device_list(dev_net(dev)),
which is currently protected by RTNL and its dedicated mutex,
phonet_device_list.lock.

We will convert addr_doit() to RCU and cannot use mutex inside RCU.

Let's convert the mutex to spinlock_t.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Kuniyuki Iwashima
2024-10-17 11:31:34 -07:00
committed by Paolo Abeni
parent 68ed5c38b5
commit 42f5fe1dc4
2 changed files with 19 additions and 10 deletions

View File

@@ -12,12 +12,13 @@
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
struct net;
struct phonet_device_list {
struct list_head list;
struct mutex lock;
spinlock_t lock;
};
struct phonet_device_list *phonet_device_list(struct net *net);