summaryrefslogtreecommitdiffstats
path: root/kernel/net/netfilter/ipset/ip_set_bitmap_port.c
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2011-03-25 11:10:29 +0100
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2011-03-25 11:10:29 +0100
commitd90a2f5b8998f9063ff8aa7ae0fb301e3933f709 (patch)
tree5788a1833816977c3f6004136d591e6737c9102e /kernel/net/netfilter/ipset/ip_set_bitmap_port.c
parent48509af4bc2a60c368c46f1351ddf5370e012bc0 (diff)
References are protected by rwlock instead of mutex
The timeout variant of the list:set type must reference the member sets. However, its garbage collector runs at timer interrupt so the mutex protection of the references is a no go. Therefore the reference protection is converted to rwlock.
Diffstat (limited to 'kernel/net/netfilter/ipset/ip_set_bitmap_port.c')
-rw-r--r--kernel/net/netfilter/ipset/ip_set_bitmap_port.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/net/netfilter/ipset/ip_set_bitmap_port.c b/kernel/net/netfilter/ipset/ip_set_bitmap_port.c
index 165f09b..6b38eb8 100644
--- a/kernel/net/netfilter/ipset/ip_set_bitmap_port.c
+++ b/kernel/net/netfilter/ipset/ip_set_bitmap_port.c
@@ -320,8 +320,7 @@ bitmap_port_head(struct ip_set *set, struct sk_buff *skb)
goto nla_put_failure;
NLA_PUT_NET16(skb, IPSET_ATTR_PORT, htons(map->first_port));
NLA_PUT_NET16(skb, IPSET_ATTR_PORT_TO, htons(map->last_port));
- NLA_PUT_NET32(skb, IPSET_ATTR_REFERENCES,
- htonl(atomic_read(&set->ref) - 1));
+ NLA_PUT_NET32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1));
NLA_PUT_NET32(skb, IPSET_ATTR_MEMSIZE,
htonl(sizeof(*map) + map->memsize));
if (with_timeout(map->timeout))