diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-12 06:43:05 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-12 06:43:05 -0500 |
commit | 81444a799550214f549caf579cf65a0ca55e70b7 (patch) | |
tree | 3288dac0740be2e1e7d1af4ee51d792a6e91edf3 /net | |
parent | a64d31baed104be25305e9c71585d3ea4ee9a418 (diff) | |
parent | da485e0cb16726797e99a595a399b9fc721b91bc (diff) |
Merge branch 'tracing/fastboot' into cpus4096
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/br_netfilter.c | 13 | ||||
-rw-r--r-- | net/core/skbuff.c | 2 | ||||
-rw-r--r-- | net/core/sock.c | 31 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 7 | ||||
-rw-r--r-- | net/mac80211/wext.c | 8 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 2 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 7 | ||||
-rw-r--r-- | net/phonet/pn_dev.c | 2 | ||||
-rw-r--r-- | net/rose/af_rose.c | 10 | ||||
-rw-r--r-- | net/sunrpc/svcsock.c | 9 | ||||
-rw-r--r-- | net/unix/af_unix.c | 2 | ||||
-rw-r--r-- | net/unix/garbage.c | 13 | ||||
-rw-r--r-- | net/wireless/reg.c | 4 |
13 files changed, 75 insertions, 35 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index fa5cda4e552a..45f61c348e36 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -101,6 +101,18 @@ static inline __be16 pppoe_proto(const struct sk_buff *skb) | |||
101 | pppoe_proto(skb) == htons(PPP_IPV6) && \ | 101 | pppoe_proto(skb) == htons(PPP_IPV6) && \ |
102 | brnf_filter_pppoe_tagged) | 102 | brnf_filter_pppoe_tagged) |
103 | 103 | ||
104 | static void fake_update_pmtu(struct dst_entry *dst, u32 mtu) | ||
105 | { | ||
106 | } | ||
107 | |||
108 | static struct dst_ops fake_dst_ops = { | ||
109 | .family = AF_INET, | ||
110 | .protocol = __constant_htons(ETH_P_IP), | ||
111 | .update_pmtu = fake_update_pmtu, | ||
112 | .entry_size = sizeof(struct rtable), | ||
113 | .entries = ATOMIC_INIT(0), | ||
114 | }; | ||
115 | |||
104 | /* | 116 | /* |
105 | * Initialize bogus route table used to keep netfilter happy. | 117 | * Initialize bogus route table used to keep netfilter happy. |
106 | * Currently, we fill in the PMTU entry because netfilter | 118 | * Currently, we fill in the PMTU entry because netfilter |
@@ -117,6 +129,7 @@ void br_netfilter_rtable_init(struct net_bridge *br) | |||
117 | rt->u.dst.path = &rt->u.dst; | 129 | rt->u.dst.path = &rt->u.dst; |
118 | rt->u.dst.metrics[RTAX_MTU - 1] = 1500; | 130 | rt->u.dst.metrics[RTAX_MTU - 1] = 1500; |
119 | rt->u.dst.flags = DST_NOXFRM; | 131 | rt->u.dst.flags = DST_NOXFRM; |
132 | rt->u.dst.ops = &fake_dst_ops; | ||
120 | } | 133 | } |
121 | 134 | ||
122 | static inline struct rtable *bridge_parent_rtable(const struct net_device *dev) | 135 | static inline struct rtable *bridge_parent_rtable(const struct net_device *dev) |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index d49ef8301b5b..65f7757465bd 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -149,7 +149,7 @@ void skb_under_panic(struct sk_buff *skb, int sz, void *here) | |||
149 | 149 | ||
150 | void skb_truesize_bug(struct sk_buff *skb) | 150 | void skb_truesize_bug(struct sk_buff *skb) |
151 | { | 151 | { |
152 | printk(KERN_ERR "SKB BUG: Invalid truesize (%u) " | 152 | WARN(net_ratelimit(), KERN_ERR "SKB BUG: Invalid truesize (%u) " |
153 | "len=%u, sizeof(sk_buff)=%Zd\n", | 153 | "len=%u, sizeof(sk_buff)=%Zd\n", |
154 | skb->truesize, skb->len, sizeof(struct sk_buff)); | 154 | skb->truesize, skb->len, sizeof(struct sk_buff)); |
155 | } | 155 | } |
diff --git a/net/core/sock.c b/net/core/sock.c index 341e39456952..edf7220889a4 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -2035,9 +2035,6 @@ static inline void release_proto_idx(struct proto *prot) | |||
2035 | 2035 | ||
2036 | int proto_register(struct proto *prot, int alloc_slab) | 2036 | int proto_register(struct proto *prot, int alloc_slab) |
2037 | { | 2037 | { |
2038 | char *request_sock_slab_name = NULL; | ||
2039 | char *timewait_sock_slab_name; | ||
2040 | |||
2041 | if (alloc_slab) { | 2038 | if (alloc_slab) { |
2042 | prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0, | 2039 | prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0, |
2043 | SLAB_HWCACHE_ALIGN, NULL); | 2040 | SLAB_HWCACHE_ALIGN, NULL); |
@@ -2051,12 +2048,12 @@ int proto_register(struct proto *prot, int alloc_slab) | |||
2051 | if (prot->rsk_prot != NULL) { | 2048 | if (prot->rsk_prot != NULL) { |
2052 | static const char mask[] = "request_sock_%s"; | 2049 | static const char mask[] = "request_sock_%s"; |
2053 | 2050 | ||
2054 | request_sock_slab_name = kmalloc(strlen(prot->name) + sizeof(mask) - 1, GFP_KERNEL); | 2051 | prot->rsk_prot->slab_name = kmalloc(strlen(prot->name) + sizeof(mask) - 1, GFP_KERNEL); |
2055 | if (request_sock_slab_name == NULL) | 2052 | if (prot->rsk_prot->slab_name == NULL) |
2056 | goto out_free_sock_slab; | 2053 | goto out_free_sock_slab; |
2057 | 2054 | ||
2058 | sprintf(request_sock_slab_name, mask, prot->name); | 2055 | sprintf(prot->rsk_prot->slab_name, mask, prot->name); |
2059 | prot->rsk_prot->slab = kmem_cache_create(request_sock_slab_name, | 2056 | prot->rsk_prot->slab = kmem_cache_create(prot->rsk_prot->slab_name, |
2060 | prot->rsk_prot->obj_size, 0, | 2057 | prot->rsk_prot->obj_size, 0, |
2061 | SLAB_HWCACHE_ALIGN, NULL); | 2058 | SLAB_HWCACHE_ALIGN, NULL); |
2062 | 2059 | ||
@@ -2070,14 +2067,14 @@ int proto_register(struct proto *prot, int alloc_slab) | |||
2070 | if (prot->twsk_prot != NULL) { | 2067 | if (prot->twsk_prot != NULL) { |
2071 | static const char mask[] = "tw_sock_%s"; | 2068 | static const char mask[] = "tw_sock_%s"; |
2072 | 2069 | ||
2073 | timewait_sock_slab_name = kmalloc(strlen(prot->name) + sizeof(mask) - 1, GFP_KERNEL); | 2070 | prot->twsk_prot->twsk_slab_name = kmalloc(strlen(prot->name) + sizeof(mask) - 1, GFP_KERNEL); |
2074 | 2071 | ||
2075 | if (timewait_sock_slab_name == NULL) | 2072 | if (prot->twsk_prot->twsk_slab_name == NULL) |
2076 | goto out_free_request_sock_slab; | 2073 | goto out_free_request_sock_slab; |
2077 | 2074 | ||
2078 | sprintf(timewait_sock_slab_name, mask, prot->name); | 2075 | sprintf(prot->twsk_prot->twsk_slab_name, mask, prot->name); |
2079 | prot->twsk_prot->twsk_slab = | 2076 | prot->twsk_prot->twsk_slab = |
2080 | kmem_cache_create(timewait_sock_slab_name, | 2077 | kmem_cache_create(prot->twsk_prot->twsk_slab_name, |
2081 | prot->twsk_prot->twsk_obj_size, | 2078 | prot->twsk_prot->twsk_obj_size, |
2082 | 0, SLAB_HWCACHE_ALIGN, | 2079 | 0, SLAB_HWCACHE_ALIGN, |
2083 | NULL); | 2080 | NULL); |
@@ -2093,14 +2090,14 @@ int proto_register(struct proto *prot, int alloc_slab) | |||
2093 | return 0; | 2090 | return 0; |
2094 | 2091 | ||
2095 | out_free_timewait_sock_slab_name: | 2092 | out_free_timewait_sock_slab_name: |
2096 | kfree(timewait_sock_slab_name); | 2093 | kfree(prot->twsk_prot->twsk_slab_name); |
2097 | out_free_request_sock_slab: | 2094 | out_free_request_sock_slab: |
2098 | if (prot->rsk_prot && prot->rsk_prot->slab) { | 2095 | if (prot->rsk_prot && prot->rsk_prot->slab) { |
2099 | kmem_cache_destroy(prot->rsk_prot->slab); | 2096 | kmem_cache_destroy(prot->rsk_prot->slab); |
2100 | prot->rsk_prot->slab = NULL; | 2097 | prot->rsk_prot->slab = NULL; |
2101 | } | 2098 | } |
2102 | out_free_request_sock_slab_name: | 2099 | out_free_request_sock_slab_name: |
2103 | kfree(request_sock_slab_name); | 2100 | kfree(prot->rsk_prot->slab_name); |
2104 | out_free_sock_slab: | 2101 | out_free_sock_slab: |
2105 | kmem_cache_destroy(prot->slab); | 2102 | kmem_cache_destroy(prot->slab); |
2106 | prot->slab = NULL; | 2103 | prot->slab = NULL; |
@@ -2123,18 +2120,14 @@ void proto_unregister(struct proto *prot) | |||
2123 | } | 2120 | } |
2124 | 2121 | ||
2125 | if (prot->rsk_prot != NULL && prot->rsk_prot->slab != NULL) { | 2122 | if (prot->rsk_prot != NULL && prot->rsk_prot->slab != NULL) { |
2126 | const char *name = kmem_cache_name(prot->rsk_prot->slab); | ||
2127 | |||
2128 | kmem_cache_destroy(prot->rsk_prot->slab); | 2123 | kmem_cache_destroy(prot->rsk_prot->slab); |
2129 | kfree(name); | 2124 | kfree(prot->rsk_prot->slab_name); |
2130 | prot->rsk_prot->slab = NULL; | 2125 | prot->rsk_prot->slab = NULL; |
2131 | } | 2126 | } |
2132 | 2127 | ||
2133 | if (prot->twsk_prot != NULL && prot->twsk_prot->twsk_slab != NULL) { | 2128 | if (prot->twsk_prot != NULL && prot->twsk_prot->twsk_slab != NULL) { |
2134 | const char *name = kmem_cache_name(prot->twsk_prot->twsk_slab); | ||
2135 | |||
2136 | kmem_cache_destroy(prot->twsk_prot->twsk_slab); | 2129 | kmem_cache_destroy(prot->twsk_prot->twsk_slab); |
2137 | kfree(name); | 2130 | kfree(prot->twsk_prot->twsk_slab_name); |
2138 | prot->twsk_prot->twsk_slab = NULL; | 2131 | prot->twsk_prot->twsk_slab = NULL; |
2139 | } | 2132 | } |
2140 | } | 2133 | } |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index ba85d8831893..85b07eba1879 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -722,7 +722,8 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb) | |||
722 | static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, | 722 | static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, |
723 | unsigned int mss_now) | 723 | unsigned int mss_now) |
724 | { | 724 | { |
725 | if (skb->len <= mss_now || !sk_can_gso(sk)) { | 725 | if (skb->len <= mss_now || !sk_can_gso(sk) || |
726 | tcp_urg_mode(tcp_sk(sk))) { | ||
726 | /* Avoid the costly divide in the normal | 727 | /* Avoid the costly divide in the normal |
727 | * non-TSO case. | 728 | * non-TSO case. |
728 | */ | 729 | */ |
@@ -1163,7 +1164,9 @@ static int tcp_init_tso_segs(struct sock *sk, struct sk_buff *skb, | |||
1163 | { | 1164 | { |
1164 | int tso_segs = tcp_skb_pcount(skb); | 1165 | int tso_segs = tcp_skb_pcount(skb); |
1165 | 1166 | ||
1166 | if (!tso_segs || (tso_segs > 1 && tcp_skb_mss(skb) != mss_now)) { | 1167 | if (!tso_segs || |
1168 | (tso_segs > 1 && (tcp_skb_mss(skb) != mss_now || | ||
1169 | tcp_urg_mode(tcp_sk(sk))))) { | ||
1167 | tcp_set_skb_tso_segs(sk, skb, mss_now); | 1170 | tcp_set_skb_tso_segs(sk, skb, mss_now); |
1168 | tso_segs = tcp_skb_pcount(skb); | 1171 | tso_segs = tcp_skb_pcount(skb); |
1169 | } | 1172 | } |
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c index 742f811ca416..ab4ddba874be 100644 --- a/net/mac80211/wext.c +++ b/net/mac80211/wext.c | |||
@@ -271,6 +271,7 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev, | |||
271 | __u32 *mode, char *extra) | 271 | __u32 *mode, char *extra) |
272 | { | 272 | { |
273 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 273 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
274 | struct ieee80211_local *local = sdata->local; | ||
274 | int type; | 275 | int type; |
275 | 276 | ||
276 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) | 277 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) |
@@ -281,6 +282,13 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev, | |||
281 | type = NL80211_IFTYPE_STATION; | 282 | type = NL80211_IFTYPE_STATION; |
282 | break; | 283 | break; |
283 | case IW_MODE_ADHOC: | 284 | case IW_MODE_ADHOC: |
285 | /* Setting ad-hoc mode on non ibss channel is not | ||
286 | * supported. | ||
287 | */ | ||
288 | if (local->oper_channel && | ||
289 | (local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS)) | ||
290 | return -EOPNOTSUPP; | ||
291 | |||
284 | type = NL80211_IFTYPE_ADHOC; | 292 | type = NL80211_IFTYPE_ADHOC; |
285 | break; | 293 | break; |
286 | case IW_MODE_REPEAT: | 294 | case IW_MODE_REPEAT: |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 622d7c671cb7..233fdd2d7d21 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -305,9 +305,7 @@ void nf_conntrack_hash_insert(struct nf_conn *ct) | |||
305 | hash = hash_conntrack(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple); | 305 | hash = hash_conntrack(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple); |
306 | repl_hash = hash_conntrack(&ct->tuplehash[IP_CT_DIR_REPLY].tuple); | 306 | repl_hash = hash_conntrack(&ct->tuplehash[IP_CT_DIR_REPLY].tuple); |
307 | 307 | ||
308 | spin_lock_bh(&nf_conntrack_lock); | ||
309 | __nf_conntrack_hash_insert(ct, hash, repl_hash); | 308 | __nf_conntrack_hash_insert(ct, hash, repl_hash); |
310 | spin_unlock_bh(&nf_conntrack_lock); | ||
311 | } | 309 | } |
312 | EXPORT_SYMBOL_GPL(nf_conntrack_hash_insert); | 310 | EXPORT_SYMBOL_GPL(nf_conntrack_hash_insert); |
313 | 311 | ||
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index a040d46f85d6..5f4a6516b3b6 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -1090,7 +1090,7 @@ ctnetlink_create_conntrack(struct nlattr *cda[], | |||
1090 | struct nf_conn_help *help; | 1090 | struct nf_conn_help *help; |
1091 | struct nf_conntrack_helper *helper; | 1091 | struct nf_conntrack_helper *helper; |
1092 | 1092 | ||
1093 | ct = nf_conntrack_alloc(&init_net, otuple, rtuple, GFP_KERNEL); | 1093 | ct = nf_conntrack_alloc(&init_net, otuple, rtuple, GFP_ATOMIC); |
1094 | if (ct == NULL || IS_ERR(ct)) | 1094 | if (ct == NULL || IS_ERR(ct)) |
1095 | return -ENOMEM; | 1095 | return -ENOMEM; |
1096 | 1096 | ||
@@ -1138,7 +1138,7 @@ ctnetlink_create_conntrack(struct nlattr *cda[], | |||
1138 | } | 1138 | } |
1139 | } | 1139 | } |
1140 | 1140 | ||
1141 | nf_ct_acct_ext_add(ct, GFP_KERNEL); | 1141 | nf_ct_acct_ext_add(ct, GFP_ATOMIC); |
1142 | 1142 | ||
1143 | #if defined(CONFIG_NF_CONNTRACK_MARK) | 1143 | #if defined(CONFIG_NF_CONNTRACK_MARK) |
1144 | if (cda[CTA_MARK]) | 1144 | if (cda[CTA_MARK]) |
@@ -1212,13 +1212,14 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
1212 | atomic_inc(&master_ct->ct_general.use); | 1212 | atomic_inc(&master_ct->ct_general.use); |
1213 | } | 1213 | } |
1214 | 1214 | ||
1215 | spin_unlock_bh(&nf_conntrack_lock); | ||
1216 | err = -ENOENT; | 1215 | err = -ENOENT; |
1217 | if (nlh->nlmsg_flags & NLM_F_CREATE) | 1216 | if (nlh->nlmsg_flags & NLM_F_CREATE) |
1218 | err = ctnetlink_create_conntrack(cda, | 1217 | err = ctnetlink_create_conntrack(cda, |
1219 | &otuple, | 1218 | &otuple, |
1220 | &rtuple, | 1219 | &rtuple, |
1221 | master_ct); | 1220 | master_ct); |
1221 | spin_unlock_bh(&nf_conntrack_lock); | ||
1222 | |||
1222 | if (err < 0 && master_ct) | 1223 | if (err < 0 && master_ct) |
1223 | nf_ct_put(master_ct); | 1224 | nf_ct_put(master_ct); |
1224 | 1225 | ||
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index 53be9fc82aaa..f93ff8ef47d0 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c | |||
@@ -115,7 +115,7 @@ int phonet_address_del(struct net_device *dev, u8 addr) | |||
115 | pnd = __phonet_get(dev); | 115 | pnd = __phonet_get(dev); |
116 | if (!pnd || !test_and_clear_bit(addr >> 2, pnd->addrs)) | 116 | if (!pnd || !test_and_clear_bit(addr >> 2, pnd->addrs)) |
117 | err = -EADDRNOTAVAIL; | 117 | err = -EADDRNOTAVAIL; |
118 | if (bitmap_empty(pnd->addrs, 64)) | 118 | else if (bitmap_empty(pnd->addrs, 64)) |
119 | __phonet_device_free(pnd); | 119 | __phonet_device_free(pnd); |
120 | spin_unlock_bh(&pndevs.lock); | 120 | spin_unlock_bh(&pndevs.lock); |
121 | return err; | 121 | return err; |
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index a7f1ce11bc22..0c1cc7612800 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -1072,6 +1072,10 @@ static int rose_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1072 | unsigned char *asmptr; | 1072 | unsigned char *asmptr; |
1073 | int n, size, qbit = 0; | 1073 | int n, size, qbit = 0; |
1074 | 1074 | ||
1075 | /* ROSE empty frame has no meaning : don't send */ | ||
1076 | if (len == 0) | ||
1077 | return 0; | ||
1078 | |||
1075 | if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT)) | 1079 | if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT)) |
1076 | return -EINVAL; | 1080 | return -EINVAL; |
1077 | 1081 | ||
@@ -1265,6 +1269,12 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1265 | skb_reset_transport_header(skb); | 1269 | skb_reset_transport_header(skb); |
1266 | copied = skb->len; | 1270 | copied = skb->len; |
1267 | 1271 | ||
1272 | /* ROSE empty frame has no meaning : ignore it */ | ||
1273 | if (copied == 0) { | ||
1274 | skb_free_datagram(sk, skb); | ||
1275 | return copied; | ||
1276 | } | ||
1277 | |||
1268 | if (copied > size) { | 1278 | if (copied > size) { |
1269 | copied = size; | 1279 | copied = size; |
1270 | msg->msg_flags |= MSG_TRUNC; | 1280 | msg->msg_flags |= MSG_TRUNC; |
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 95293f549e9c..a1951dcc5776 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -1183,7 +1183,11 @@ int svc_addsock(struct svc_serv *serv, | |||
1183 | else if (so->state > SS_UNCONNECTED) | 1183 | else if (so->state > SS_UNCONNECTED) |
1184 | err = -EISCONN; | 1184 | err = -EISCONN; |
1185 | else { | 1185 | else { |
1186 | svsk = svc_setup_socket(serv, so, &err, SVC_SOCK_DEFAULTS); | 1186 | if (!try_module_get(THIS_MODULE)) |
1187 | err = -ENOENT; | ||
1188 | else | ||
1189 | svsk = svc_setup_socket(serv, so, &err, | ||
1190 | SVC_SOCK_DEFAULTS); | ||
1187 | if (svsk) { | 1191 | if (svsk) { |
1188 | struct sockaddr_storage addr; | 1192 | struct sockaddr_storage addr; |
1189 | struct sockaddr *sin = (struct sockaddr *)&addr; | 1193 | struct sockaddr *sin = (struct sockaddr *)&addr; |
@@ -1196,7 +1200,8 @@ int svc_addsock(struct svc_serv *serv, | |||
1196 | spin_unlock_bh(&serv->sv_lock); | 1200 | spin_unlock_bh(&serv->sv_lock); |
1197 | svc_xprt_received(&svsk->sk_xprt); | 1201 | svc_xprt_received(&svsk->sk_xprt); |
1198 | err = 0; | 1202 | err = 0; |
1199 | } | 1203 | } else |
1204 | module_put(THIS_MODULE); | ||
1200 | } | 1205 | } |
1201 | if (err) { | 1206 | if (err) { |
1202 | sockfd_put(so); | 1207 | sockfd_put(so); |
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index eb90f77bb0e2..66d5ac4773ab 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -1343,6 +1343,7 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
1343 | 1343 | ||
1344 | if (NULL == siocb->scm) | 1344 | if (NULL == siocb->scm) |
1345 | siocb->scm = &tmp_scm; | 1345 | siocb->scm = &tmp_scm; |
1346 | wait_for_unix_gc(); | ||
1346 | err = scm_send(sock, msg, siocb->scm); | 1347 | err = scm_send(sock, msg, siocb->scm); |
1347 | if (err < 0) | 1348 | if (err < 0) |
1348 | return err; | 1349 | return err; |
@@ -1493,6 +1494,7 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
1493 | 1494 | ||
1494 | if (NULL == siocb->scm) | 1495 | if (NULL == siocb->scm) |
1495 | siocb->scm = &tmp_scm; | 1496 | siocb->scm = &tmp_scm; |
1497 | wait_for_unix_gc(); | ||
1496 | err = scm_send(sock, msg, siocb->scm); | 1498 | err = scm_send(sock, msg, siocb->scm); |
1497 | if (err < 0) | 1499 | if (err < 0) |
1498 | return err; | 1500 | return err; |
diff --git a/net/unix/garbage.c b/net/unix/garbage.c index 6d4a9a8de5ef..abb3ab34cb1e 100644 --- a/net/unix/garbage.c +++ b/net/unix/garbage.c | |||
@@ -80,6 +80,7 @@ | |||
80 | #include <linux/file.h> | 80 | #include <linux/file.h> |
81 | #include <linux/proc_fs.h> | 81 | #include <linux/proc_fs.h> |
82 | #include <linux/mutex.h> | 82 | #include <linux/mutex.h> |
83 | #include <linux/wait.h> | ||
83 | 84 | ||
84 | #include <net/sock.h> | 85 | #include <net/sock.h> |
85 | #include <net/af_unix.h> | 86 | #include <net/af_unix.h> |
@@ -91,6 +92,7 @@ | |||
91 | static LIST_HEAD(gc_inflight_list); | 92 | static LIST_HEAD(gc_inflight_list); |
92 | static LIST_HEAD(gc_candidates); | 93 | static LIST_HEAD(gc_candidates); |
93 | static DEFINE_SPINLOCK(unix_gc_lock); | 94 | static DEFINE_SPINLOCK(unix_gc_lock); |
95 | static DECLARE_WAIT_QUEUE_HEAD(unix_gc_wait); | ||
94 | 96 | ||
95 | unsigned int unix_tot_inflight; | 97 | unsigned int unix_tot_inflight; |
96 | 98 | ||
@@ -266,12 +268,16 @@ static void inc_inflight_move_tail(struct unix_sock *u) | |||
266 | list_move_tail(&u->link, &gc_candidates); | 268 | list_move_tail(&u->link, &gc_candidates); |
267 | } | 269 | } |
268 | 270 | ||
269 | /* The external entry point: unix_gc() */ | 271 | static bool gc_in_progress = false; |
270 | 272 | ||
271 | void unix_gc(void) | 273 | void wait_for_unix_gc(void) |
272 | { | 274 | { |
273 | static bool gc_in_progress = false; | 275 | wait_event(unix_gc_wait, gc_in_progress == false); |
276 | } | ||
274 | 277 | ||
278 | /* The external entry point: unix_gc() */ | ||
279 | void unix_gc(void) | ||
280 | { | ||
275 | struct unix_sock *u; | 281 | struct unix_sock *u; |
276 | struct unix_sock *next; | 282 | struct unix_sock *next; |
277 | struct sk_buff_head hitlist; | 283 | struct sk_buff_head hitlist; |
@@ -376,6 +382,7 @@ void unix_gc(void) | |||
376 | /* All candidates should have been detached by now. */ | 382 | /* All candidates should have been detached by now. */ |
377 | BUG_ON(!list_empty(&gc_candidates)); | 383 | BUG_ON(!list_empty(&gc_candidates)); |
378 | gc_in_progress = false; | 384 | gc_in_progress = false; |
385 | wake_up(&unix_gc_wait); | ||
379 | 386 | ||
380 | out: | 387 | out: |
381 | spin_unlock(&unix_gc_lock); | 388 | spin_unlock(&unix_gc_lock); |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 626dbb688499..eb3b1a9f9b12 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -343,9 +343,9 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, | |||
343 | return 0; | 343 | return 0; |
344 | return -EALREADY; | 344 | return -EALREADY; |
345 | } | 345 | } |
346 | if (WARN_ON(!is_alpha2_set(alpha2) || !is_an_alpha2(alpha2)), | 346 | if (WARN(!is_alpha2_set(alpha2) || !is_an_alpha2(alpha2), |
347 | "Invalid Country IE regulatory hint passed " | 347 | "Invalid Country IE regulatory hint passed " |
348 | "to the wireless core\n") | 348 | "to the wireless core\n")) |
349 | return -EINVAL; | 349 | return -EINVAL; |
350 | /* We ignore Country IE hints for now, as we haven't yet | 350 | /* We ignore Country IE hints for now, as we haven't yet |
351 | * added the dot11MultiDomainCapabilityEnabled flag | 351 | * added the dot11MultiDomainCapabilityEnabled flag |