[Devel] [PATCH RHEL7 COMMIT] ms/netfilter: Replace spin_is_locked() with lockdep

Vasily Averin vvs at virtuozzo.com
Tue Dec 15 12:22:24 MSK 2020


The commit is pushed to "branch-rh7-3.10.0-1160.6.1.vz7.171.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.6.1.vz7.171.4
------>
commit feca123b54148d68b49ddf71efe31e189706e07c
Author: Lance Roy <ldr709 at gmail.com>
Date:   Tue Dec 15 12:22:24 2020 +0300

    ms/netfilter: Replace spin_is_locked() with lockdep
    
    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 at gmail.com>
    Cc: Pablo Neira Ayuso <pablo at netfilter.org>
    Cc: Jozsef Kadlecsik <kadlec at blackhole.kfki.hu>
    Cc: Florian Westphal <fw at strlen.de>
    Cc: "David S. Miller" <davem at davemloft.net>
    Cc: <netfilter-devel at vger.kernel.org>
    Cc: <coreteam at netfilter.org>
    Cc: <netdev at vger.kernel.org>
    Acked-by: Jozsef Kadlecsik <kadlec at blackhole.kfki.hu>
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
    
    (cherry-picked from commit 4b87dd54be21ad611a1c740f9df0c4376d496e09)
    https://jira.sw.ru/browse/PSBM-123086
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 net/netfilter/ipset/ip_set_hash_gen.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h
index 225348a..a437adf 100644
--- a/net/netfilter/ipset/ip_set_hash_gen.h
+++ b/net/netfilter/ipset/ip_set_hash_gen.h
@@ -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)
 


More information about the Devel mailing list