diff options
author | Eric Dumazet <edumazet@google.com> | 2016-04-28 09:33:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-28 11:49:45 -0400 |
commit | ba7863f4d3bfe1698e0a92934cbc9c3021f4448d (patch) | |
tree | 1c16be7df70cdc963ef59fd3e9c5ecfb553fda00 | |
parent | 8be2748a40cb84c2ac5085e7e6bccb5a5fcc6235 (diff) |
net: snmp: fix 64bit stats on 32bit arches
I accidentally replaced BH disabling by preemption disabling
in SNMP_ADD_STATS64() and SNMP_UPD_PO_STATS64() on 32bit builds.
For 64bit stats on 32bit arch, we really need to disable BH,
since the "struct u64_stats_sync syncp" might be manipulated
both from process and BH contexts.
Fixes: 6aef70a851ac ("net: snmp: kill various STATS_USER() helpers")
Reported-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Tested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/snmp.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/net/snmp.h b/include/net/snmp.h index 6bdd255b2250..c9228ad7ee91 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h | |||
@@ -166,9 +166,9 @@ struct linux_xfrm_mib { | |||
166 | 166 | ||
167 | #define SNMP_ADD_STATS64(mib, field, addend) \ | 167 | #define SNMP_ADD_STATS64(mib, field, addend) \ |
168 | do { \ | 168 | do { \ |
169 | preempt_disable(); \ | 169 | local_bh_disable(); \ |
170 | __SNMP_ADD_STATS64(mib, field, addend); \ | 170 | __SNMP_ADD_STATS64(mib, field, addend); \ |
171 | preempt_enable(); \ | 171 | local_bh_enable(); \ |
172 | } while (0) | 172 | } while (0) |
173 | 173 | ||
174 | #define __SNMP_INC_STATS64(mib, field) SNMP_ADD_STATS64(mib, field, 1) | 174 | #define __SNMP_INC_STATS64(mib, field) SNMP_ADD_STATS64(mib, field, 1) |
@@ -184,9 +184,9 @@ struct linux_xfrm_mib { | |||
184 | } while (0) | 184 | } while (0) |
185 | #define SNMP_UPD_PO_STATS64(mib, basefield, addend) \ | 185 | #define SNMP_UPD_PO_STATS64(mib, basefield, addend) \ |
186 | do { \ | 186 | do { \ |
187 | preempt_disable(); \ | 187 | local_bh_disable(); \ |
188 | __SNMP_UPD_PO_STATS64(mib, basefield, addend); \ | 188 | __SNMP_UPD_PO_STATS64(mib, basefield, addend); \ |
189 | preempt_enable(); \ | 189 | local_bh_enable(); \ |
190 | } while (0) | 190 | } while (0) |
191 | #else | 191 | #else |
192 | #define __SNMP_INC_STATS64(mib, field) __SNMP_INC_STATS(mib, field) | 192 | #define __SNMP_INC_STATS64(mib, field) __SNMP_INC_STATS(mib, field) |