diff options
author | Julian Anastasov <ja@ssi.bg> | 2013-04-17 16:50:50 -0400 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2013-04-22 22:43:05 -0400 |
commit | 371990eeec13f9fdee9a5e1d3d811ad24a5cb25e (patch) | |
tree | 818e502235808c673510f12e66ad6cb17af15024 /net/netfilter | |
parent | 7cf2eb7bccbe0d7a8ab1d1382c4faa2b3abf817f (diff) |
ipvs: fix the remaining sparse warnings in ip_vs_ctl.c
- RCU annotations for ip_vs_info_seq_start and _stop
- __percpu for cpustats
- properly dereference svc->pe in ip_vs_genl_fill_service
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_ctl.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 5a6544475b3c..64075a775e35 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c | |||
@@ -1937,8 +1937,8 @@ static struct ip_vs_service *ip_vs_info_array(struct seq_file *seq, loff_t pos) | |||
1937 | } | 1937 | } |
1938 | 1938 | ||
1939 | static void *ip_vs_info_seq_start(struct seq_file *seq, loff_t *pos) | 1939 | static void *ip_vs_info_seq_start(struct seq_file *seq, loff_t *pos) |
1940 | __acquires(RCU) | ||
1940 | { | 1941 | { |
1941 | |||
1942 | rcu_read_lock(); | 1942 | rcu_read_lock(); |
1943 | return *pos ? ip_vs_info_array(seq, *pos - 1) : SEQ_START_TOKEN; | 1943 | return *pos ? ip_vs_info_array(seq, *pos - 1) : SEQ_START_TOKEN; |
1944 | } | 1944 | } |
@@ -1993,6 +1993,7 @@ static void *ip_vs_info_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
1993 | } | 1993 | } |
1994 | 1994 | ||
1995 | static void ip_vs_info_seq_stop(struct seq_file *seq, void *v) | 1995 | static void ip_vs_info_seq_stop(struct seq_file *seq, void *v) |
1996 | __releases(RCU) | ||
1996 | { | 1997 | { |
1997 | rcu_read_unlock(); | 1998 | rcu_read_unlock(); |
1998 | } | 1999 | } |
@@ -2137,7 +2138,7 @@ static int ip_vs_stats_percpu_show(struct seq_file *seq, void *v) | |||
2137 | { | 2138 | { |
2138 | struct net *net = seq_file_single_net(seq); | 2139 | struct net *net = seq_file_single_net(seq); |
2139 | struct ip_vs_stats *tot_stats = &net_ipvs(net)->tot_stats; | 2140 | struct ip_vs_stats *tot_stats = &net_ipvs(net)->tot_stats; |
2140 | struct ip_vs_cpu_stats *cpustats = tot_stats->cpustats; | 2141 | struct ip_vs_cpu_stats __percpu *cpustats = tot_stats->cpustats; |
2141 | struct ip_vs_stats_user rates; | 2142 | struct ip_vs_stats_user rates; |
2142 | int i; | 2143 | int i; |
2143 | 2144 | ||
@@ -2874,6 +2875,7 @@ static int ip_vs_genl_fill_service(struct sk_buff *skb, | |||
2874 | struct ip_vs_service *svc) | 2875 | struct ip_vs_service *svc) |
2875 | { | 2876 | { |
2876 | struct ip_vs_scheduler *sched; | 2877 | struct ip_vs_scheduler *sched; |
2878 | struct ip_vs_pe *pe; | ||
2877 | struct nlattr *nl_service; | 2879 | struct nlattr *nl_service; |
2878 | struct ip_vs_flags flags = { .flags = svc->flags, | 2880 | struct ip_vs_flags flags = { .flags = svc->flags, |
2879 | .mask = ~0 }; | 2881 | .mask = ~0 }; |
@@ -2895,9 +2897,9 @@ static int ip_vs_genl_fill_service(struct sk_buff *skb, | |||
2895 | } | 2897 | } |
2896 | 2898 | ||
2897 | sched = rcu_dereference_protected(svc->scheduler, 1); | 2899 | sched = rcu_dereference_protected(svc->scheduler, 1); |
2900 | pe = rcu_dereference_protected(svc->pe, 1); | ||
2898 | if (nla_put_string(skb, IPVS_SVC_ATTR_SCHED_NAME, sched->name) || | 2901 | if (nla_put_string(skb, IPVS_SVC_ATTR_SCHED_NAME, sched->name) || |
2899 | (svc->pe && | 2902 | (pe && nla_put_string(skb, IPVS_SVC_ATTR_PE_NAME, pe->name)) || |
2900 | nla_put_string(skb, IPVS_SVC_ATTR_PE_NAME, svc->pe->name)) || | ||
2901 | nla_put(skb, IPVS_SVC_ATTR_FLAGS, sizeof(flags), &flags) || | 2903 | nla_put(skb, IPVS_SVC_ATTR_FLAGS, sizeof(flags), &flags) || |
2902 | nla_put_u32(skb, IPVS_SVC_ATTR_TIMEOUT, svc->timeout / HZ) || | 2904 | nla_put_u32(skb, IPVS_SVC_ATTR_TIMEOUT, svc->timeout / HZ) || |
2903 | nla_put_u32(skb, IPVS_SVC_ATTR_NETMASK, svc->netmask)) | 2905 | nla_put_u32(skb, IPVS_SVC_ATTR_NETMASK, svc->netmask)) |