netfilter: conntrack: init all_locks to avoid debug warning
Subsystems (2)
Florian Westphal
maintainerPATCH 1/1 netfilter: conntrack: init all_locks to avoid debug warning
Else we get 'BUG: spinlock bad magic on CPU#' on resize when spin lock debugging is enabled.
--- net/netfilter/nf_conntrack_core.c | 2 ++ 1 file changed, 2 insertions(+)
net/netfilter/nf_conntrack_core.c +2 -0
@@ -1659,6 +1659,8 @@ int nf_conntrack_init_start(void)for (i =0 ; i <CONNTRACK_LOCKS ; i++)spin_lock_init (&nf_conntrack_locks[i]); +spin_lock_init (&nf_conntrack_locks_all_lock); +if (!nf_conntrack_htable_size) {/* Idea from tcp.c: use 1/16384 of memory. * On i386: 32MB machine has 512 buckets.
Signature · 1 line
2.7.3
Quoted 2 lines · Florian Westphal
Else we get 'BUG: spinlock bad magic on CPU#' on resize when spin lock debugging is enabled.
Applied, thanks Florian.
Pablo Neira Ayuso
maintainerQuoted 5 lines · Pablo Neira Ayuso
Quoted 2 lines · Florian Westphal
Else we get 'BUG: spinlock bad magic on CPU#' on resize when spin lock debugging is enabled.
Applied, thanks Florian.
Wait, probably better this?
commit 70d72b7e060e0a16b9ded9d0fbd3dff109743de3
Author: Florian Westphal <[email protected]> Date: Sun Apr 24 01:17:14 2016 +0200
netfilter: conntrack: init all_locks to avoid debug warning
Else we get 'BUG: spinlock bad magic on CPU#' on resize when spin lock debugging is enabled.
net/netfilter/nf_conntrack_core.c +1 -1
@@ -66,7 +66,7 @@ EXPORT_SYMBOL_GPL(nf_conntrack_locks);__cacheline_aligned_in_smp DEFINE_SPINLOCK (nf_conntrack_expect_lock );EXPORT_SYMBOL_GPL (nf_conntrack_expect_lock); -static __read_mostly spinlock_t nf_conntrack_locks_all_lock; +static __read_mostly DEFINE_SPINLOCK (nf_conntrack_locks_all_lock);static __read_mostly bool nf_conntrack_locks_all; void nf_conntrack_lock(spinlock_t *lock) __acquires(lock)
Florian Westphal
maintainerQuoted 8 lines · Pablo Neira Ayuso
Quoted 5 lines · Pablo Neira Ayuso
Quoted 2 lines · Florian Westphal
Else we get 'BUG: spinlock bad magic on CPU#' on resize when spin lock debugging is enabled.
Applied, thanks Florian.
Wait, probably better this?
I have no preference, either patch works for me.