netfilter: Replace spin_is_locked() with lockdep
authorLance Roy <ldr709@gmail.com>
Wed, 3 Oct 2018 05:39:00 +0000 (22:39 -0700)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 16 Oct 2018 08:01:47 +0000 (10:01 +0200)
lockdep_assert_held() is better suited to checking locking requirements,
since it won't get confused when someone else holds the lock. This is
also a step towards possibly removing spin_is_locked().

Signed-off-by: Lance Roy <ldr709@gmail.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: Florian Westphal <fw@strlen.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: <netfilter-devel@vger.kernel.org>
Cc: <coreteam@netfilter.org>
Cc: <netdev@vger.kernel.org>
Acked-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/ipset/ip_set_hash_gen.h

index 8a33dac4e8058b0ec07281814f5c90507421eb4e..e287da68d5fa7e5b21db700abf76a5ac537d5f94 100644 (file)
@@ -15,7 +15,7 @@
 
 #define __ipset_dereference_protected(p, c)    rcu_dereference_protected(p, c)
 #define ipset_dereference_protected(p, set) \
-       __ipset_dereference_protected(p, spin_is_locked(&(set)->lock))
+       __ipset_dereference_protected(p, lockdep_is_held(&(set)->lock))
 
 #define rcu_dereference_bh_nfnl(p)     rcu_dereference_bh_check(p, 1)