]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
net: pktgen: remove rcu locking in pktgen_change_name()
authorEric Dumazet <edumazet@google.com>
Sat, 15 Oct 2016 15:50:49 +0000 (17:50 +0200)
committerLuis Henriques <luis.henriques@canonical.com>
Tue, 6 Dec 2016 16:52:25 +0000 (16:52 +0000)
commit6f250f516f6d2e1a657ae7bce899914fd0c5ff86
tree45515ba63383e082df78fa43a00d05c081adb424
parent274704a1bea4ba04a2637ac4cc14e0ede4d0fc78
net: pktgen: remove rcu locking in pktgen_change_name()

BugLink: http://bugs.launchpad.net/bugs/1642573
[ Upstream commit 9a0b1e8ba4061778897b544afc898de2163382f7 ]

After Jesper commit back in linux-3.18, we trigger a lockdep
splat in proc_create_data() while allocating memory from
pktgen_change_name().

This patch converts t->if_lock to a mutex, since it is now only
used from control path, and adds proper locking to pktgen_change_name()

1) pktgen_thread_lock to protect the outer loop (iterating threads)
2) t->if_lock to protect the inner loop (iterating devices)

Note that before Jesper patch, pktgen_change_name() was lacking proper
protection, but lockdep was not able to detect the problem.

Fixes: 8788370a1d4b ("pktgen: RCU-ify "if_list" to remove lock in next_to_run()")
Reported-by: John Sperbeck <jsperbeck@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
net/core/pktgen.c