]> git.ipfire.org Git - thirdparty/linux.git/commit
phonet: Convert phonet_routes.lock to spinlock_t.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Thu, 17 Oct 2024 18:31:39 +0000 (11:31 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 24 Oct 2024 14:03:40 +0000 (16:03 +0200)
commit3deec3b4afb4c767007eae1eeedbcf3da599395b
tree1096e23e95996513d2a076745f3aad2cbf67d0ce
parentde51ad08b1177bbbb8b60cb7dd4c3c5dd50d262f
phonet: Convert phonet_routes.lock to spinlock_t.

route_doit() calls phonet_route_add() or phonet_route_del()
for RTM_NEWROUTE or RTM_DELROUTE, respectively.

Both functions only touch phonet_pernet(dev_net(dev))->routes,
which is currently protected by RTNL and its dedicated mutex,
phonet_routes.lock.

We will convert route_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>
include/net/phonet/pn_dev.h
net/phonet/pn_dev.c