aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-02-28 13:13:16 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-02-28 13:13:16 -0500
commit642c4c75a765d7a3244ab39c8e6fb09be21eca5b (patch)
treece0be9b476f362835d3a3d6e4fd32801cd15c9fe /net
parentf91b22c35f6b0ae06ec5b67922eca1999c3b6e0a (diff)
parent71da81324c83ef65bb196c7f874ac1c6996d8287 (diff)
Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (44 commits) rcu: Fix accelerated GPs for last non-dynticked CPU rcu: Make non-RCU_PROVE_LOCKING rcu_read_lock_sched_held() understand boot rcu: Fix accelerated grace periods for last non-dynticked CPU rcu: Export rcu_scheduler_active rcu: Make rcu_read_lock_sched_held() take boot time into account rcu: Make lockdep_rcu_dereference() message less alarmist sched, cgroups: Fix module export rcu: Add RCU_CPU_STALL_VERBOSE to dump detailed per-task information rcu: Fix rcutorture mod_timer argument to delay one jiffy rcu: Fix deadlock in TREE_PREEMPT_RCU CPU stall detection rcu: Convert to raw_spinlocks rcu: Stop overflowing signed integers rcu: Use canonical URL for Mathieu's dissertation rcu: Accelerate grace period if last non-dynticked CPU rcu: Fix citation of Mathieu's dissertation rcu: Documentation update for CONFIG_PROVE_RCU security: Apply lockdep-based checking to rcu_dereference() uses idr: Apply lockdep-based diagnostics to rcu_dereference() uses radix-tree: Disable RCU lockdep checking in radix tree vfs: Abstract rcu_dereference_check for files-fdtable use ...
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c2
-rw-r--r--net/core/filter.c6
-rw-r--r--net/core/rtnetlink.c8
-rw-r--r--net/core/sock.c3
-rw-r--r--net/decnet/dn_route.c14
-rw-r--r--net/ipv4/route.c14
-rw-r--r--net/packet/af_packet.c2
7 files changed, 29 insertions, 20 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index ec874218b206..bb1f1da2b8a7 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2041,7 +2041,7 @@ gso:
2041 rcu_read_lock_bh(); 2041 rcu_read_lock_bh();
2042 2042
2043 txq = dev_pick_tx(dev, skb); 2043 txq = dev_pick_tx(dev, skb);
2044 q = rcu_dereference(txq->qdisc); 2044 q = rcu_dereference_bh(txq->qdisc);
2045 2045
2046#ifdef CONFIG_NET_CLS_ACT 2046#ifdef CONFIG_NET_CLS_ACT
2047 skb->tc_verd = SET_TC_AT(skb->tc_verd, AT_EGRESS); 2047 skb->tc_verd = SET_TC_AT(skb->tc_verd, AT_EGRESS);
diff --git a/net/core/filter.c b/net/core/filter.c
index 08db7b9143a3..3541aa48d21d 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -86,7 +86,7 @@ int sk_filter(struct sock *sk, struct sk_buff *skb)
86 return err; 86 return err;
87 87
88 rcu_read_lock_bh(); 88 rcu_read_lock_bh();
89 filter = rcu_dereference(sk->sk_filter); 89 filter = rcu_dereference_bh(sk->sk_filter);
90 if (filter) { 90 if (filter) {
91 unsigned int pkt_len = sk_run_filter(skb, filter->insns, 91 unsigned int pkt_len = sk_run_filter(skb, filter->insns,
92 filter->len); 92 filter->len);
@@ -521,7 +521,7 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
521 } 521 }
522 522
523 rcu_read_lock_bh(); 523 rcu_read_lock_bh();
524 old_fp = rcu_dereference(sk->sk_filter); 524 old_fp = rcu_dereference_bh(sk->sk_filter);
525 rcu_assign_pointer(sk->sk_filter, fp); 525 rcu_assign_pointer(sk->sk_filter, fp);
526 rcu_read_unlock_bh(); 526 rcu_read_unlock_bh();
527 527
@@ -536,7 +536,7 @@ int sk_detach_filter(struct sock *sk)
536 struct sk_filter *filter; 536 struct sk_filter *filter;
537 537
538 rcu_read_lock_bh(); 538 rcu_read_lock_bh();
539 filter = rcu_dereference(sk->sk_filter); 539 filter = rcu_dereference_bh(sk->sk_filter);
540 if (filter) { 540 if (filter) {
541 rcu_assign_pointer(sk->sk_filter, NULL); 541 rcu_assign_pointer(sk->sk_filter, NULL);
542 sk_filter_delayed_uncharge(sk, filter); 542 sk_filter_delayed_uncharge(sk, filter);
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 794bcb897ff0..4c7d3f635ba7 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -89,6 +89,14 @@ int rtnl_is_locked(void)
89} 89}
90EXPORT_SYMBOL(rtnl_is_locked); 90EXPORT_SYMBOL(rtnl_is_locked);
91 91
92#ifdef CONFIG_PROVE_LOCKING
93int lockdep_rtnl_is_held(void)
94{
95 return lockdep_is_held(&rtnl_mutex);
96}
97EXPORT_SYMBOL(lockdep_rtnl_is_held);
98#endif /* #ifdef CONFIG_PROVE_LOCKING */
99
92static struct rtnl_link *rtnl_msg_handlers[NPROTO]; 100static struct rtnl_link *rtnl_msg_handlers[NPROTO];
93 101
94static inline int rtm_msgindex(int msgtype) 102static inline int rtm_msgindex(int msgtype)
diff --git a/net/core/sock.c b/net/core/sock.c
index e1f6f225f012..305cba401ae6 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1073,7 +1073,8 @@ static void __sk_free(struct sock *sk)
1073 if (sk->sk_destruct) 1073 if (sk->sk_destruct)
1074 sk->sk_destruct(sk); 1074 sk->sk_destruct(sk);
1075 1075
1076 filter = rcu_dereference(sk->sk_filter); 1076 filter = rcu_dereference_check(sk->sk_filter,
1077 atomic_read(&sk->sk_wmem_alloc) == 0);
1077 if (filter) { 1078 if (filter) {
1078 sk_filter_uncharge(sk, filter); 1079 sk_filter_uncharge(sk, filter);
1079 rcu_assign_pointer(sk->sk_filter, NULL); 1080 rcu_assign_pointer(sk->sk_filter, NULL);
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index a03284061a31..a7bf03ca0a36 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -1155,8 +1155,8 @@ static int __dn_route_output_key(struct dst_entry **pprt, const struct flowi *fl
1155 1155
1156 if (!(flags & MSG_TRYHARD)) { 1156 if (!(flags & MSG_TRYHARD)) {
1157 rcu_read_lock_bh(); 1157 rcu_read_lock_bh();
1158 for(rt = rcu_dereference(dn_rt_hash_table[hash].chain); rt; 1158 for (rt = rcu_dereference_bh(dn_rt_hash_table[hash].chain); rt;
1159 rt = rcu_dereference(rt->u.dst.dn_next)) { 1159 rt = rcu_dereference_bh(rt->u.dst.dn_next)) {
1160 if ((flp->fld_dst == rt->fl.fld_dst) && 1160 if ((flp->fld_dst == rt->fl.fld_dst) &&
1161 (flp->fld_src == rt->fl.fld_src) && 1161 (flp->fld_src == rt->fl.fld_src) &&
1162 (flp->mark == rt->fl.mark) && 1162 (flp->mark == rt->fl.mark) &&
@@ -1618,9 +1618,9 @@ int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb)
1618 if (h > s_h) 1618 if (h > s_h)
1619 s_idx = 0; 1619 s_idx = 0;
1620 rcu_read_lock_bh(); 1620 rcu_read_lock_bh();
1621 for(rt = rcu_dereference(dn_rt_hash_table[h].chain), idx = 0; 1621 for(rt = rcu_dereference_bh(dn_rt_hash_table[h].chain), idx = 0;
1622 rt; 1622 rt;
1623 rt = rcu_dereference(rt->u.dst.dn_next), idx++) { 1623 rt = rcu_dereference_bh(rt->u.dst.dn_next), idx++) {
1624 if (idx < s_idx) 1624 if (idx < s_idx)
1625 continue; 1625 continue;
1626 skb_dst_set(skb, dst_clone(&rt->u.dst)); 1626 skb_dst_set(skb, dst_clone(&rt->u.dst));
@@ -1654,12 +1654,12 @@ static struct dn_route *dn_rt_cache_get_first(struct seq_file *seq)
1654 1654
1655 for(s->bucket = dn_rt_hash_mask; s->bucket >= 0; --s->bucket) { 1655 for(s->bucket = dn_rt_hash_mask; s->bucket >= 0; --s->bucket) {
1656 rcu_read_lock_bh(); 1656 rcu_read_lock_bh();
1657 rt = dn_rt_hash_table[s->bucket].chain; 1657 rt = rcu_dereference_bh(dn_rt_hash_table[s->bucket].chain);
1658 if (rt) 1658 if (rt)
1659 break; 1659 break;
1660 rcu_read_unlock_bh(); 1660 rcu_read_unlock_bh();
1661 } 1661 }
1662 return rcu_dereference(rt); 1662 return rt;
1663} 1663}
1664 1664
1665static struct dn_route *dn_rt_cache_get_next(struct seq_file *seq, struct dn_route *rt) 1665static struct dn_route *dn_rt_cache_get_next(struct seq_file *seq, struct dn_route *rt)
@@ -1674,7 +1674,7 @@ static struct dn_route *dn_rt_cache_get_next(struct seq_file *seq, struct dn_rou
1674 rcu_read_lock_bh(); 1674 rcu_read_lock_bh();
1675 rt = dn_rt_hash_table[s->bucket].chain; 1675 rt = dn_rt_hash_table[s->bucket].chain;
1676 } 1676 }
1677 return rcu_dereference(rt); 1677 return rcu_dereference_bh(rt);
1678} 1678}
1679 1679
1680static void *dn_rt_cache_seq_start(struct seq_file *seq, loff_t *pos) 1680static void *dn_rt_cache_seq_start(struct seq_file *seq, loff_t *pos)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index d62b05d33384..4f11faa5c824 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -287,12 +287,12 @@ static struct rtable *rt_cache_get_first(struct seq_file *seq)
287 if (!rt_hash_table[st->bucket].chain) 287 if (!rt_hash_table[st->bucket].chain)
288 continue; 288 continue;
289 rcu_read_lock_bh(); 289 rcu_read_lock_bh();
290 r = rcu_dereference(rt_hash_table[st->bucket].chain); 290 r = rcu_dereference_bh(rt_hash_table[st->bucket].chain);
291 while (r) { 291 while (r) {
292 if (dev_net(r->u.dst.dev) == seq_file_net(seq) && 292 if (dev_net(r->u.dst.dev) == seq_file_net(seq) &&
293 r->rt_genid == st->genid) 293 r->rt_genid == st->genid)
294 return r; 294 return r;
295 r = rcu_dereference(r->u.dst.rt_next); 295 r = rcu_dereference_bh(r->u.dst.rt_next);
296 } 296 }
297 rcu_read_unlock_bh(); 297 rcu_read_unlock_bh();
298 } 298 }
@@ -314,7 +314,7 @@ static struct rtable *__rt_cache_get_next(struct seq_file *seq,
314 rcu_read_lock_bh(); 314 rcu_read_lock_bh();
315 r = rt_hash_table[st->bucket].chain; 315 r = rt_hash_table[st->bucket].chain;
316 } 316 }
317 return rcu_dereference(r); 317 return rcu_dereference_bh(r);
318} 318}
319 319
320static struct rtable *rt_cache_get_next(struct seq_file *seq, 320static struct rtable *rt_cache_get_next(struct seq_file *seq,
@@ -2689,8 +2689,8 @@ int __ip_route_output_key(struct net *net, struct rtable **rp,
2689 hash = rt_hash(flp->fl4_dst, flp->fl4_src, flp->oif, rt_genid(net)); 2689 hash = rt_hash(flp->fl4_dst, flp->fl4_src, flp->oif, rt_genid(net));
2690 2690
2691 rcu_read_lock_bh(); 2691 rcu_read_lock_bh();
2692 for (rth = rcu_dereference(rt_hash_table[hash].chain); rth; 2692 for (rth = rcu_dereference_bh(rt_hash_table[hash].chain); rth;
2693 rth = rcu_dereference(rth->u.dst.rt_next)) { 2693 rth = rcu_dereference_bh(rth->u.dst.rt_next)) {
2694 if (rth->fl.fl4_dst == flp->fl4_dst && 2694 if (rth->fl.fl4_dst == flp->fl4_dst &&
2695 rth->fl.fl4_src == flp->fl4_src && 2695 rth->fl.fl4_src == flp->fl4_src &&
2696 rth->fl.iif == 0 && 2696 rth->fl.iif == 0 &&
@@ -3008,8 +3008,8 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb)
3008 if (!rt_hash_table[h].chain) 3008 if (!rt_hash_table[h].chain)
3009 continue; 3009 continue;
3010 rcu_read_lock_bh(); 3010 rcu_read_lock_bh();
3011 for (rt = rcu_dereference(rt_hash_table[h].chain), idx = 0; rt; 3011 for (rt = rcu_dereference_bh(rt_hash_table[h].chain), idx = 0; rt;
3012 rt = rcu_dereference(rt->u.dst.rt_next), idx++) { 3012 rt = rcu_dereference_bh(rt->u.dst.rt_next), idx++) {
3013 if (!net_eq(dev_net(rt->u.dst.dev), net) || idx < s_idx) 3013 if (!net_eq(dev_net(rt->u.dst.dev), net) || idx < s_idx)
3014 continue; 3014 continue;
3015 if (rt_is_expired(rt)) 3015 if (rt_is_expired(rt))
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index f126d18dbdc4..939471ef8d50 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -508,7 +508,7 @@ static inline unsigned int run_filter(struct sk_buff *skb, struct sock *sk,
508 struct sk_filter *filter; 508 struct sk_filter *filter;
509 509
510 rcu_read_lock_bh(); 510 rcu_read_lock_bh();
511 filter = rcu_dereference(sk->sk_filter); 511 filter = rcu_dereference_bh(sk->sk_filter);
512 if (filter != NULL) 512 if (filter != NULL)
513 res = sk_run_filter(skb, filter->insns, filter->len); 513 res = sk_run_filter(skb, filter->insns, filter->len);
514 rcu_read_unlock_bh(); 514 rcu_read_unlock_bh();