diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-08-16 06:22:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-17 18:12:14 -0400 |
commit | 001389b9581c13fe5fc357a0f89234f85af4215d (patch) | |
tree | fdf6e017a99229c90d3075b35d7f62edee924c8e | |
parent | 5ca6f7c85159a5ca7e637b1d9f79f0d9bc56e5dc (diff) |
netfilter: {ip,ip6,arp}_tables: avoid lockdep false positive
After commit 24b36f019 (netfilter: {ip,ip6,arp}_tables: dont block
bottom half more than necessary), lockdep can raise a warning
because we attempt to lock a spinlock with BH enabled, while
the same lock is usually locked by another cpu in a softirq context.
Disable again BH to avoid these lockdep warnings.
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Diagnosed-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/netfilter/arp_tables.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_tables.c | 2 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index 6bccba31d132..51d6c3167975 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c | |||
@@ -735,6 +735,7 @@ static void get_counters(const struct xt_table_info *t, | |||
735 | if (cpu == curcpu) | 735 | if (cpu == curcpu) |
736 | continue; | 736 | continue; |
737 | i = 0; | 737 | i = 0; |
738 | local_bh_disable(); | ||
738 | xt_info_wrlock(cpu); | 739 | xt_info_wrlock(cpu); |
739 | xt_entry_foreach(iter, t->entries[cpu], t->size) { | 740 | xt_entry_foreach(iter, t->entries[cpu], t->size) { |
740 | ADD_COUNTER(counters[i], iter->counters.bcnt, | 741 | ADD_COUNTER(counters[i], iter->counters.bcnt, |
@@ -742,6 +743,7 @@ static void get_counters(const struct xt_table_info *t, | |||
742 | ++i; | 743 | ++i; |
743 | } | 744 | } |
744 | xt_info_wrunlock(cpu); | 745 | xt_info_wrunlock(cpu); |
746 | local_bh_enable(); | ||
745 | } | 747 | } |
746 | put_cpu(); | 748 | put_cpu(); |
747 | } | 749 | } |
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index c439721b165a..97b64b22c412 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -909,6 +909,7 @@ get_counters(const struct xt_table_info *t, | |||
909 | if (cpu == curcpu) | 909 | if (cpu == curcpu) |
910 | continue; | 910 | continue; |
911 | i = 0; | 911 | i = 0; |
912 | local_bh_disable(); | ||
912 | xt_info_wrlock(cpu); | 913 | xt_info_wrlock(cpu); |
913 | xt_entry_foreach(iter, t->entries[cpu], t->size) { | 914 | xt_entry_foreach(iter, t->entries[cpu], t->size) { |
914 | ADD_COUNTER(counters[i], iter->counters.bcnt, | 915 | ADD_COUNTER(counters[i], iter->counters.bcnt, |
@@ -916,6 +917,7 @@ get_counters(const struct xt_table_info *t, | |||
916 | ++i; /* macro does multi eval of i */ | 917 | ++i; /* macro does multi eval of i */ |
917 | } | 918 | } |
918 | xt_info_wrunlock(cpu); | 919 | xt_info_wrunlock(cpu); |
920 | local_bh_enable(); | ||
919 | } | 921 | } |
920 | put_cpu(); | 922 | put_cpu(); |
921 | } | 923 | } |
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 5359ef4daac5..29a7bca29e3f 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -922,6 +922,7 @@ get_counters(const struct xt_table_info *t, | |||
922 | if (cpu == curcpu) | 922 | if (cpu == curcpu) |
923 | continue; | 923 | continue; |
924 | i = 0; | 924 | i = 0; |
925 | local_bh_disable(); | ||
925 | xt_info_wrlock(cpu); | 926 | xt_info_wrlock(cpu); |
926 | xt_entry_foreach(iter, t->entries[cpu], t->size) { | 927 | xt_entry_foreach(iter, t->entries[cpu], t->size) { |
927 | ADD_COUNTER(counters[i], iter->counters.bcnt, | 928 | ADD_COUNTER(counters[i], iter->counters.bcnt, |
@@ -929,6 +930,7 @@ get_counters(const struct xt_table_info *t, | |||
929 | ++i; | 930 | ++i; |
930 | } | 931 | } |
931 | xt_info_wrunlock(cpu); | 932 | xt_info_wrunlock(cpu); |
933 | local_bh_enable(); | ||
932 | } | 934 | } |
933 | put_cpu(); | 935 | put_cpu(); |
934 | } | 936 | } |