diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-10-09 16:13:30 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-10-09 16:13:30 -0400 |
commit | 670aee3fc7ac37ae947f8b582d87b51d5fa36524 (patch) | |
tree | 9885998483d4506208e5aef9c13c8a86adea20bb /net | |
parent | d61e87ac53292a3138b4354b687558973686b6ca (diff) | |
parent | 55582bccdc1e89ecc973c260d46e247df675d4df (diff) |
Merge branches 'pm-devfreq' and 'pm-cpufreq'
* pm-devfreq:
PM / devfreq: fix double kfree
PM / devfreq: Fix governor_store()
* pm-cpufreq:
cpufreq: prevent lockup on reading scaling_available_frequencies
cpufreq: acpi_cpufreq: prevent crash on reading freqdomain_cpus
Diffstat (limited to 'net')
-rw-r--r-- | net/core/net-sysfs.c | 3 | ||||
-rw-r--r-- | net/core/skbuff.c | 9 | ||||
-rw-r--r-- | net/dsa/slave.c | 11 | ||||
-rw-r--r-- | net/ipv4/fib_frontend.c | 1 | ||||
-rw-r--r-- | net/ipv4/route.c | 1 | ||||
-rw-r--r-- | net/ipv6/route.c | 3 | ||||
-rw-r--r-- | net/l2tp/l2tp_core.c | 11 | ||||
-rw-r--r-- | net/sctp/associola.c | 20 | ||||
-rw-r--r-- | net/sctp/sm_sideeffect.c | 44 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/fmr_ops.c | 19 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/frwr_ops.c | 5 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/physical_ops.c | 10 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/verbs.c | 2 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/xprt_rdma.h | 1 | ||||
-rw-r--r-- | net/unix/af_unix.c | 15 |
15 files changed, 78 insertions, 77 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 805a95a48107..830f8a7c1cb1 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
@@ -31,7 +31,6 @@ | |||
31 | static const char fmt_hex[] = "%#x\n"; | 31 | static const char fmt_hex[] = "%#x\n"; |
32 | static const char fmt_long_hex[] = "%#lx\n"; | 32 | static const char fmt_long_hex[] = "%#lx\n"; |
33 | static const char fmt_dec[] = "%d\n"; | 33 | static const char fmt_dec[] = "%d\n"; |
34 | static const char fmt_udec[] = "%u\n"; | ||
35 | static const char fmt_ulong[] = "%lu\n"; | 34 | static const char fmt_ulong[] = "%lu\n"; |
36 | static const char fmt_u64[] = "%llu\n"; | 35 | static const char fmt_u64[] = "%llu\n"; |
37 | 36 | ||
@@ -202,7 +201,7 @@ static ssize_t speed_show(struct device *dev, | |||
202 | if (netif_running(netdev)) { | 201 | if (netif_running(netdev)) { |
203 | struct ethtool_cmd cmd; | 202 | struct ethtool_cmd cmd; |
204 | if (!__ethtool_get_settings(netdev, &cmd)) | 203 | if (!__ethtool_get_settings(netdev, &cmd)) |
205 | ret = sprintf(buf, fmt_udec, ethtool_cmd_speed(&cmd)); | 204 | ret = sprintf(buf, fmt_dec, ethtool_cmd_speed(&cmd)); |
206 | } | 205 | } |
207 | rtnl_unlock(); | 206 | rtnl_unlock(); |
208 | return ret; | 207 | return ret; |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index dad4dd37e2aa..fab4599ba8b2 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -2958,11 +2958,12 @@ EXPORT_SYMBOL_GPL(skb_append_pagefrags); | |||
2958 | */ | 2958 | */ |
2959 | unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len) | 2959 | unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len) |
2960 | { | 2960 | { |
2961 | unsigned char *data = skb->data; | ||
2962 | |||
2961 | BUG_ON(len > skb->len); | 2963 | BUG_ON(len > skb->len); |
2962 | skb->len -= len; | 2964 | __skb_pull(skb, len); |
2963 | BUG_ON(skb->len < skb->data_len); | 2965 | skb_postpull_rcsum(skb, data, len); |
2964 | skb_postpull_rcsum(skb, skb->data, len); | 2966 | return skb->data; |
2965 | return skb->data += len; | ||
2966 | } | 2967 | } |
2967 | EXPORT_SYMBOL_GPL(skb_pull_rcsum); | 2968 | EXPORT_SYMBOL_GPL(skb_pull_rcsum); |
2968 | 2969 | ||
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index cce97385f743..7d91f4612ac0 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c | |||
@@ -458,12 +458,17 @@ static int dsa_slave_stp_update(struct net_device *dev, u8 state) | |||
458 | static int dsa_slave_port_attr_set(struct net_device *dev, | 458 | static int dsa_slave_port_attr_set(struct net_device *dev, |
459 | struct switchdev_attr *attr) | 459 | struct switchdev_attr *attr) |
460 | { | 460 | { |
461 | int ret = 0; | 461 | struct dsa_slave_priv *p = netdev_priv(dev); |
462 | struct dsa_switch *ds = p->parent; | ||
463 | int ret; | ||
462 | 464 | ||
463 | switch (attr->id) { | 465 | switch (attr->id) { |
464 | case SWITCHDEV_ATTR_PORT_STP_STATE: | 466 | case SWITCHDEV_ATTR_PORT_STP_STATE: |
465 | if (attr->trans == SWITCHDEV_TRANS_COMMIT) | 467 | if (attr->trans == SWITCHDEV_TRANS_PREPARE) |
466 | ret = dsa_slave_stp_update(dev, attr->u.stp_state); | 468 | ret = ds->drv->port_stp_update ? 0 : -EOPNOTSUPP; |
469 | else | ||
470 | ret = ds->drv->port_stp_update(ds, p->port, | ||
471 | attr->u.stp_state); | ||
467 | break; | 472 | break; |
468 | default: | 473 | default: |
469 | ret = -EOPNOTSUPP; | 474 | ret = -EOPNOTSUPP; |
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 6fcbd215cdbc..690bcbc59f26 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -340,6 +340,7 @@ static int __fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst, | |||
340 | fl4.flowi4_tos = tos; | 340 | fl4.flowi4_tos = tos; |
341 | fl4.flowi4_scope = RT_SCOPE_UNIVERSE; | 341 | fl4.flowi4_scope = RT_SCOPE_UNIVERSE; |
342 | fl4.flowi4_tun_key.tun_id = 0; | 342 | fl4.flowi4_tun_key.tun_id = 0; |
343 | fl4.flowi4_flags = 0; | ||
343 | 344 | ||
344 | no_addr = idev->ifa_list == NULL; | 345 | no_addr = idev->ifa_list == NULL; |
345 | 346 | ||
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index c6ad99ad0ffb..c81deb85acb4 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1737,6 +1737,7 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr, | |||
1737 | fl4.flowi4_mark = skb->mark; | 1737 | fl4.flowi4_mark = skb->mark; |
1738 | fl4.flowi4_tos = tos; | 1738 | fl4.flowi4_tos = tos; |
1739 | fl4.flowi4_scope = RT_SCOPE_UNIVERSE; | 1739 | fl4.flowi4_scope = RT_SCOPE_UNIVERSE; |
1740 | fl4.flowi4_flags = 0; | ||
1740 | fl4.daddr = daddr; | 1741 | fl4.daddr = daddr; |
1741 | fl4.saddr = saddr; | 1742 | fl4.saddr = saddr; |
1742 | err = fib_lookup(net, &fl4, &res, 0); | 1743 | err = fib_lookup(net, &fl4, &res, 0); |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index f204089e854c..cb32ce250db0 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -1193,7 +1193,8 @@ struct dst_entry *ip6_route_output(struct net *net, const struct sock *sk, | |||
1193 | 1193 | ||
1194 | fl6->flowi6_iif = LOOPBACK_IFINDEX; | 1194 | fl6->flowi6_iif = LOOPBACK_IFINDEX; |
1195 | 1195 | ||
1196 | if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl6->daddr)) | 1196 | if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl6->daddr) || |
1197 | fl6->flowi6_oif) | ||
1197 | flags |= RT6_LOOKUP_F_IFACE; | 1198 | flags |= RT6_LOOKUP_F_IFACE; |
1198 | 1199 | ||
1199 | if (!ipv6_addr_any(&fl6->saddr)) | 1200 | if (!ipv6_addr_any(&fl6->saddr)) |
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index f6b090df3930..afca2eb4dfa7 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c | |||
@@ -1319,7 +1319,7 @@ static void l2tp_tunnel_del_work(struct work_struct *work) | |||
1319 | tunnel = container_of(work, struct l2tp_tunnel, del_work); | 1319 | tunnel = container_of(work, struct l2tp_tunnel, del_work); |
1320 | sk = l2tp_tunnel_sock_lookup(tunnel); | 1320 | sk = l2tp_tunnel_sock_lookup(tunnel); |
1321 | if (!sk) | 1321 | if (!sk) |
1322 | return; | 1322 | goto out; |
1323 | 1323 | ||
1324 | sock = sk->sk_socket; | 1324 | sock = sk->sk_socket; |
1325 | 1325 | ||
@@ -1341,6 +1341,8 @@ static void l2tp_tunnel_del_work(struct work_struct *work) | |||
1341 | } | 1341 | } |
1342 | 1342 | ||
1343 | l2tp_tunnel_sock_put(sk); | 1343 | l2tp_tunnel_sock_put(sk); |
1344 | out: | ||
1345 | l2tp_tunnel_dec_refcount(tunnel); | ||
1344 | } | 1346 | } |
1345 | 1347 | ||
1346 | /* Create a socket for the tunnel, if one isn't set up by | 1348 | /* Create a socket for the tunnel, if one isn't set up by |
@@ -1636,8 +1638,13 @@ EXPORT_SYMBOL_GPL(l2tp_tunnel_create); | |||
1636 | */ | 1638 | */ |
1637 | int l2tp_tunnel_delete(struct l2tp_tunnel *tunnel) | 1639 | int l2tp_tunnel_delete(struct l2tp_tunnel *tunnel) |
1638 | { | 1640 | { |
1641 | l2tp_tunnel_inc_refcount(tunnel); | ||
1639 | l2tp_tunnel_closeall(tunnel); | 1642 | l2tp_tunnel_closeall(tunnel); |
1640 | return (false == queue_work(l2tp_wq, &tunnel->del_work)); | 1643 | if (false == queue_work(l2tp_wq, &tunnel->del_work)) { |
1644 | l2tp_tunnel_dec_refcount(tunnel); | ||
1645 | return 1; | ||
1646 | } | ||
1647 | return 0; | ||
1641 | } | 1648 | } |
1642 | EXPORT_SYMBOL_GPL(l2tp_tunnel_delete); | 1649 | EXPORT_SYMBOL_GPL(l2tp_tunnel_delete); |
1643 | 1650 | ||
diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 197c3f59ecbf..b00f1f9611d6 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c | |||
@@ -1208,20 +1208,22 @@ void sctp_assoc_update(struct sctp_association *asoc, | |||
1208 | * within this document. | 1208 | * within this document. |
1209 | * | 1209 | * |
1210 | * Our basic strategy is to round-robin transports in priorities | 1210 | * Our basic strategy is to round-robin transports in priorities |
1211 | * according to sctp_state_prio_map[] e.g., if no such | 1211 | * according to sctp_trans_score() e.g., if no such |
1212 | * transport with state SCTP_ACTIVE exists, round-robin through | 1212 | * transport with state SCTP_ACTIVE exists, round-robin through |
1213 | * SCTP_UNKNOWN, etc. You get the picture. | 1213 | * SCTP_UNKNOWN, etc. You get the picture. |
1214 | */ | 1214 | */ |
1215 | static const u8 sctp_trans_state_to_prio_map[] = { | ||
1216 | [SCTP_ACTIVE] = 3, /* best case */ | ||
1217 | [SCTP_UNKNOWN] = 2, | ||
1218 | [SCTP_PF] = 1, | ||
1219 | [SCTP_INACTIVE] = 0, /* worst case */ | ||
1220 | }; | ||
1221 | |||
1222 | static u8 sctp_trans_score(const struct sctp_transport *trans) | 1215 | static u8 sctp_trans_score(const struct sctp_transport *trans) |
1223 | { | 1216 | { |
1224 | return sctp_trans_state_to_prio_map[trans->state]; | 1217 | switch (trans->state) { |
1218 | case SCTP_ACTIVE: | ||
1219 | return 3; /* best case */ | ||
1220 | case SCTP_UNKNOWN: | ||
1221 | return 2; | ||
1222 | case SCTP_PF: | ||
1223 | return 1; | ||
1224 | default: /* case SCTP_INACTIVE */ | ||
1225 | return 0; /* worst case */ | ||
1226 | } | ||
1225 | } | 1227 | } |
1226 | 1228 | ||
1227 | static struct sctp_transport *sctp_trans_elect_tie(struct sctp_transport *trans1, | 1229 | static struct sctp_transport *sctp_trans_elect_tie(struct sctp_transport *trans1, |
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 35df1266bf07..6098d4c42fa9 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
@@ -244,12 +244,13 @@ void sctp_generate_t3_rtx_event(unsigned long peer) | |||
244 | int error; | 244 | int error; |
245 | struct sctp_transport *transport = (struct sctp_transport *) peer; | 245 | struct sctp_transport *transport = (struct sctp_transport *) peer; |
246 | struct sctp_association *asoc = transport->asoc; | 246 | struct sctp_association *asoc = transport->asoc; |
247 | struct net *net = sock_net(asoc->base.sk); | 247 | struct sock *sk = asoc->base.sk; |
248 | struct net *net = sock_net(sk); | ||
248 | 249 | ||
249 | /* Check whether a task is in the sock. */ | 250 | /* Check whether a task is in the sock. */ |
250 | 251 | ||
251 | bh_lock_sock(asoc->base.sk); | 252 | bh_lock_sock(sk); |
252 | if (sock_owned_by_user(asoc->base.sk)) { | 253 | if (sock_owned_by_user(sk)) { |
253 | pr_debug("%s: sock is busy\n", __func__); | 254 | pr_debug("%s: sock is busy\n", __func__); |
254 | 255 | ||
255 | /* Try again later. */ | 256 | /* Try again later. */ |
@@ -272,10 +273,10 @@ void sctp_generate_t3_rtx_event(unsigned long peer) | |||
272 | transport, GFP_ATOMIC); | 273 | transport, GFP_ATOMIC); |
273 | 274 | ||
274 | if (error) | 275 | if (error) |
275 | asoc->base.sk->sk_err = -error; | 276 | sk->sk_err = -error; |
276 | 277 | ||
277 | out_unlock: | 278 | out_unlock: |
278 | bh_unlock_sock(asoc->base.sk); | 279 | bh_unlock_sock(sk); |
279 | sctp_transport_put(transport); | 280 | sctp_transport_put(transport); |
280 | } | 281 | } |
281 | 282 | ||
@@ -285,11 +286,12 @@ out_unlock: | |||
285 | static void sctp_generate_timeout_event(struct sctp_association *asoc, | 286 | static void sctp_generate_timeout_event(struct sctp_association *asoc, |
286 | sctp_event_timeout_t timeout_type) | 287 | sctp_event_timeout_t timeout_type) |
287 | { | 288 | { |
288 | struct net *net = sock_net(asoc->base.sk); | 289 | struct sock *sk = asoc->base.sk; |
290 | struct net *net = sock_net(sk); | ||
289 | int error = 0; | 291 | int error = 0; |
290 | 292 | ||
291 | bh_lock_sock(asoc->base.sk); | 293 | bh_lock_sock(sk); |
292 | if (sock_owned_by_user(asoc->base.sk)) { | 294 | if (sock_owned_by_user(sk)) { |
293 | pr_debug("%s: sock is busy: timer %d\n", __func__, | 295 | pr_debug("%s: sock is busy: timer %d\n", __func__, |
294 | timeout_type); | 296 | timeout_type); |
295 | 297 | ||
@@ -312,10 +314,10 @@ static void sctp_generate_timeout_event(struct sctp_association *asoc, | |||
312 | (void *)timeout_type, GFP_ATOMIC); | 314 | (void *)timeout_type, GFP_ATOMIC); |
313 | 315 | ||
314 | if (error) | 316 | if (error) |
315 | asoc->base.sk->sk_err = -error; | 317 | sk->sk_err = -error; |
316 | 318 | ||
317 | out_unlock: | 319 | out_unlock: |
318 | bh_unlock_sock(asoc->base.sk); | 320 | bh_unlock_sock(sk); |
319 | sctp_association_put(asoc); | 321 | sctp_association_put(asoc); |
320 | } | 322 | } |
321 | 323 | ||
@@ -365,10 +367,11 @@ void sctp_generate_heartbeat_event(unsigned long data) | |||
365 | int error = 0; | 367 | int error = 0; |
366 | struct sctp_transport *transport = (struct sctp_transport *) data; | 368 | struct sctp_transport *transport = (struct sctp_transport *) data; |
367 | struct sctp_association *asoc = transport->asoc; | 369 | struct sctp_association *asoc = transport->asoc; |
368 | struct net *net = sock_net(asoc->base.sk); | 370 | struct sock *sk = asoc->base.sk; |
371 | struct net *net = sock_net(sk); | ||
369 | 372 | ||
370 | bh_lock_sock(asoc->base.sk); | 373 | bh_lock_sock(sk); |
371 | if (sock_owned_by_user(asoc->base.sk)) { | 374 | if (sock_owned_by_user(sk)) { |
372 | pr_debug("%s: sock is busy\n", __func__); | 375 | pr_debug("%s: sock is busy\n", __func__); |
373 | 376 | ||
374 | /* Try again later. */ | 377 | /* Try again later. */ |
@@ -388,11 +391,11 @@ void sctp_generate_heartbeat_event(unsigned long data) | |||
388 | asoc->state, asoc->ep, asoc, | 391 | asoc->state, asoc->ep, asoc, |
389 | transport, GFP_ATOMIC); | 392 | transport, GFP_ATOMIC); |
390 | 393 | ||
391 | if (error) | 394 | if (error) |
392 | asoc->base.sk->sk_err = -error; | 395 | sk->sk_err = -error; |
393 | 396 | ||
394 | out_unlock: | 397 | out_unlock: |
395 | bh_unlock_sock(asoc->base.sk); | 398 | bh_unlock_sock(sk); |
396 | sctp_transport_put(transport); | 399 | sctp_transport_put(transport); |
397 | } | 400 | } |
398 | 401 | ||
@@ -403,10 +406,11 @@ void sctp_generate_proto_unreach_event(unsigned long data) | |||
403 | { | 406 | { |
404 | struct sctp_transport *transport = (struct sctp_transport *) data; | 407 | struct sctp_transport *transport = (struct sctp_transport *) data; |
405 | struct sctp_association *asoc = transport->asoc; | 408 | struct sctp_association *asoc = transport->asoc; |
406 | struct net *net = sock_net(asoc->base.sk); | 409 | struct sock *sk = asoc->base.sk; |
410 | struct net *net = sock_net(sk); | ||
407 | 411 | ||
408 | bh_lock_sock(asoc->base.sk); | 412 | bh_lock_sock(sk); |
409 | if (sock_owned_by_user(asoc->base.sk)) { | 413 | if (sock_owned_by_user(sk)) { |
410 | pr_debug("%s: sock is busy\n", __func__); | 414 | pr_debug("%s: sock is busy\n", __func__); |
411 | 415 | ||
412 | /* Try again later. */ | 416 | /* Try again later. */ |
@@ -427,7 +431,7 @@ void sctp_generate_proto_unreach_event(unsigned long data) | |||
427 | asoc->state, asoc->ep, asoc, transport, GFP_ATOMIC); | 431 | asoc->state, asoc->ep, asoc, transport, GFP_ATOMIC); |
428 | 432 | ||
429 | out_unlock: | 433 | out_unlock: |
430 | bh_unlock_sock(asoc->base.sk); | 434 | bh_unlock_sock(sk); |
431 | sctp_association_put(asoc); | 435 | sctp_association_put(asoc); |
432 | } | 436 | } |
433 | 437 | ||
diff --git a/net/sunrpc/xprtrdma/fmr_ops.c b/net/sunrpc/xprtrdma/fmr_ops.c index cb25c89da623..f1e8dafbd507 100644 --- a/net/sunrpc/xprtrdma/fmr_ops.c +++ b/net/sunrpc/xprtrdma/fmr_ops.c | |||
@@ -39,25 +39,6 @@ static int | |||
39 | fmr_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep, | 39 | fmr_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep, |
40 | struct rpcrdma_create_data_internal *cdata) | 40 | struct rpcrdma_create_data_internal *cdata) |
41 | { | 41 | { |
42 | struct ib_device_attr *devattr = &ia->ri_devattr; | ||
43 | struct ib_mr *mr; | ||
44 | |||
45 | /* Obtain an lkey to use for the regbufs, which are | ||
46 | * protected from remote access. | ||
47 | */ | ||
48 | if (devattr->device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY) { | ||
49 | ia->ri_dma_lkey = ia->ri_device->local_dma_lkey; | ||
50 | } else { | ||
51 | mr = ib_get_dma_mr(ia->ri_pd, IB_ACCESS_LOCAL_WRITE); | ||
52 | if (IS_ERR(mr)) { | ||
53 | pr_err("%s: ib_get_dma_mr for failed with %lX\n", | ||
54 | __func__, PTR_ERR(mr)); | ||
55 | return -ENOMEM; | ||
56 | } | ||
57 | ia->ri_dma_lkey = ia->ri_dma_mr->lkey; | ||
58 | ia->ri_dma_mr = mr; | ||
59 | } | ||
60 | |||
61 | return 0; | 42 | return 0; |
62 | } | 43 | } |
63 | 44 | ||
diff --git a/net/sunrpc/xprtrdma/frwr_ops.c b/net/sunrpc/xprtrdma/frwr_ops.c index d6653f5d0830..5318951b3b53 100644 --- a/net/sunrpc/xprtrdma/frwr_ops.c +++ b/net/sunrpc/xprtrdma/frwr_ops.c | |||
@@ -189,11 +189,6 @@ frwr_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep, | |||
189 | struct ib_device_attr *devattr = &ia->ri_devattr; | 189 | struct ib_device_attr *devattr = &ia->ri_devattr; |
190 | int depth, delta; | 190 | int depth, delta; |
191 | 191 | ||
192 | /* Obtain an lkey to use for the regbufs, which are | ||
193 | * protected from remote access. | ||
194 | */ | ||
195 | ia->ri_dma_lkey = ia->ri_device->local_dma_lkey; | ||
196 | |||
197 | ia->ri_max_frmr_depth = | 192 | ia->ri_max_frmr_depth = |
198 | min_t(unsigned int, RPCRDMA_MAX_DATA_SEGS, | 193 | min_t(unsigned int, RPCRDMA_MAX_DATA_SEGS, |
199 | devattr->max_fast_reg_page_list_len); | 194 | devattr->max_fast_reg_page_list_len); |
diff --git a/net/sunrpc/xprtrdma/physical_ops.c b/net/sunrpc/xprtrdma/physical_ops.c index 72cf8b15bbb4..617b76f22154 100644 --- a/net/sunrpc/xprtrdma/physical_ops.c +++ b/net/sunrpc/xprtrdma/physical_ops.c | |||
@@ -23,7 +23,6 @@ static int | |||
23 | physical_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep, | 23 | physical_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep, |
24 | struct rpcrdma_create_data_internal *cdata) | 24 | struct rpcrdma_create_data_internal *cdata) |
25 | { | 25 | { |
26 | struct ib_device_attr *devattr = &ia->ri_devattr; | ||
27 | struct ib_mr *mr; | 26 | struct ib_mr *mr; |
28 | 27 | ||
29 | /* Obtain an rkey to use for RPC data payloads. | 28 | /* Obtain an rkey to use for RPC data payloads. |
@@ -37,15 +36,8 @@ physical_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep, | |||
37 | __func__, PTR_ERR(mr)); | 36 | __func__, PTR_ERR(mr)); |
38 | return -ENOMEM; | 37 | return -ENOMEM; |
39 | } | 38 | } |
40 | ia->ri_dma_mr = mr; | ||
41 | |||
42 | /* Obtain an lkey to use for regbufs. | ||
43 | */ | ||
44 | if (devattr->device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY) | ||
45 | ia->ri_dma_lkey = ia->ri_device->local_dma_lkey; | ||
46 | else | ||
47 | ia->ri_dma_lkey = ia->ri_dma_mr->lkey; | ||
48 | 39 | ||
40 | ia->ri_dma_mr = mr; | ||
49 | return 0; | 41 | return 0; |
50 | } | 42 | } |
51 | 43 | ||
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index 682996779970..eb081ad05e33 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c | |||
@@ -1252,7 +1252,7 @@ rpcrdma_alloc_regbuf(struct rpcrdma_ia *ia, size_t size, gfp_t flags) | |||
1252 | goto out_free; | 1252 | goto out_free; |
1253 | 1253 | ||
1254 | iov->length = size; | 1254 | iov->length = size; |
1255 | iov->lkey = ia->ri_dma_lkey; | 1255 | iov->lkey = ia->ri_pd->local_dma_lkey; |
1256 | rb->rg_size = size; | 1256 | rb->rg_size = size; |
1257 | rb->rg_owner = NULL; | 1257 | rb->rg_owner = NULL; |
1258 | return rb; | 1258 | return rb; |
diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h index 02512221b8bc..c09414e6f91b 100644 --- a/net/sunrpc/xprtrdma/xprt_rdma.h +++ b/net/sunrpc/xprtrdma/xprt_rdma.h | |||
@@ -65,7 +65,6 @@ struct rpcrdma_ia { | |||
65 | struct rdma_cm_id *ri_id; | 65 | struct rdma_cm_id *ri_id; |
66 | struct ib_pd *ri_pd; | 66 | struct ib_pd *ri_pd; |
67 | struct ib_mr *ri_dma_mr; | 67 | struct ib_mr *ri_dma_mr; |
68 | u32 ri_dma_lkey; | ||
69 | struct completion ri_done; | 68 | struct completion ri_done; |
70 | int ri_async_rc; | 69 | int ri_async_rc; |
71 | unsigned int ri_max_frmr_depth; | 70 | unsigned int ri_max_frmr_depth; |
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 03ee4d359f6a..ef31b40ad550 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -2179,8 +2179,21 @@ unlock: | |||
2179 | if (UNIXCB(skb).fp) | 2179 | if (UNIXCB(skb).fp) |
2180 | scm.fp = scm_fp_dup(UNIXCB(skb).fp); | 2180 | scm.fp = scm_fp_dup(UNIXCB(skb).fp); |
2181 | 2181 | ||
2182 | sk_peek_offset_fwd(sk, chunk); | 2182 | if (skip) { |
2183 | sk_peek_offset_fwd(sk, chunk); | ||
2184 | skip -= chunk; | ||
2185 | } | ||
2183 | 2186 | ||
2187 | if (UNIXCB(skb).fp) | ||
2188 | break; | ||
2189 | |||
2190 | last = skb; | ||
2191 | last_len = skb->len; | ||
2192 | unix_state_lock(sk); | ||
2193 | skb = skb_peek_next(skb, &sk->sk_receive_queue); | ||
2194 | if (skb) | ||
2195 | goto again; | ||
2196 | unix_state_unlock(sk); | ||
2184 | break; | 2197 | break; |
2185 | } | 2198 | } |
2186 | } while (size); | 2199 | } while (size); |