diff options
author | David S. Miller <davem@davemloft.net> | 2010-12-27 01:37:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-27 01:37:05 -0500 |
commit | 17f7f4d9fcce8f1b75b5f735569309dee7665968 (patch) | |
tree | 14d7e49ca0053a0fcab3c33b5023bf3f90c5c08a /net | |
parent | 041110a439e21cd40709ead4ffbfa8034619ad77 (diff) | |
parent | d7c1255a3a21e98bdc64df8ccf005a174d7e6289 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
net/ipv4/fib_frontend.c
Diffstat (limited to 'net')
-rw-r--r-- | net/ceph/messenger.c | 21 | ||||
-rw-r--r-- | net/ceph/osd_client.c | 25 | ||||
-rw-r--r-- | net/ceph/pagevec.c | 16 | ||||
-rw-r--r-- | net/core/fib_rules.c | 3 | ||||
-rw-r--r-- | net/ipv4/fib_frontend.c | 10 | ||||
-rw-r--r-- | net/ipv4/route.c | 7 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 4 | ||||
-rw-r--r-- | net/irda/af_irda.c | 19 | ||||
-rw-r--r-- | net/irda/irnet/irnet_ppp.c | 1 | ||||
-rw-r--r-- | net/mac80211/Kconfig | 2 | ||||
-rw-r--r-- | net/mac80211/rx.c | 5 | ||||
-rw-r--r-- | net/sunrpc/clnt.c | 24 | ||||
-rw-r--r-- | net/sunrpc/stats.c | 4 | ||||
-rw-r--r-- | net/sunrpc/svc_xprt.c | 10 |
14 files changed, 90 insertions, 61 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 0e8157ee5d43..b6ff4a1519ab 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -97,11 +97,9 @@ struct workqueue_struct *ceph_msgr_wq; | |||
97 | int ceph_msgr_init(void) | 97 | int ceph_msgr_init(void) |
98 | { | 98 | { |
99 | ceph_msgr_wq = create_workqueue("ceph-msgr"); | 99 | ceph_msgr_wq = create_workqueue("ceph-msgr"); |
100 | if (IS_ERR(ceph_msgr_wq)) { | 100 | if (!ceph_msgr_wq) { |
101 | int ret = PTR_ERR(ceph_msgr_wq); | 101 | pr_err("msgr_init failed to create workqueue\n"); |
102 | pr_err("msgr_init failed to create workqueue: %d\n", ret); | 102 | return -ENOMEM; |
103 | ceph_msgr_wq = NULL; | ||
104 | return ret; | ||
105 | } | 103 | } |
106 | return 0; | 104 | return 0; |
107 | } | 105 | } |
@@ -540,8 +538,7 @@ static void prepare_write_message(struct ceph_connection *con) | |||
540 | /* initialize page iterator */ | 538 | /* initialize page iterator */ |
541 | con->out_msg_pos.page = 0; | 539 | con->out_msg_pos.page = 0; |
542 | if (m->pages) | 540 | if (m->pages) |
543 | con->out_msg_pos.page_pos = | 541 | con->out_msg_pos.page_pos = m->page_alignment; |
544 | le16_to_cpu(m->hdr.data_off) & ~PAGE_MASK; | ||
545 | else | 542 | else |
546 | con->out_msg_pos.page_pos = 0; | 543 | con->out_msg_pos.page_pos = 0; |
547 | con->out_msg_pos.data_pos = 0; | 544 | con->out_msg_pos.data_pos = 0; |
@@ -1491,7 +1488,7 @@ static int read_partial_message(struct ceph_connection *con) | |||
1491 | struct ceph_msg *m = con->in_msg; | 1488 | struct ceph_msg *m = con->in_msg; |
1492 | int ret; | 1489 | int ret; |
1493 | int to, left; | 1490 | int to, left; |
1494 | unsigned front_len, middle_len, data_len, data_off; | 1491 | unsigned front_len, middle_len, data_len; |
1495 | int datacrc = con->msgr->nocrc; | 1492 | int datacrc = con->msgr->nocrc; |
1496 | int skip; | 1493 | int skip; |
1497 | u64 seq; | 1494 | u64 seq; |
@@ -1527,19 +1524,17 @@ static int read_partial_message(struct ceph_connection *con) | |||
1527 | data_len = le32_to_cpu(con->in_hdr.data_len); | 1524 | data_len = le32_to_cpu(con->in_hdr.data_len); |
1528 | if (data_len > CEPH_MSG_MAX_DATA_LEN) | 1525 | if (data_len > CEPH_MSG_MAX_DATA_LEN) |
1529 | return -EIO; | 1526 | return -EIO; |
1530 | data_off = le16_to_cpu(con->in_hdr.data_off); | ||
1531 | 1527 | ||
1532 | /* verify seq# */ | 1528 | /* verify seq# */ |
1533 | seq = le64_to_cpu(con->in_hdr.seq); | 1529 | seq = le64_to_cpu(con->in_hdr.seq); |
1534 | if ((s64)seq - (s64)con->in_seq < 1) { | 1530 | if ((s64)seq - (s64)con->in_seq < 1) { |
1535 | pr_info("skipping %s%lld %s seq %lld, expected %lld\n", | 1531 | pr_info("skipping %s%lld %s seq %lld expected %lld\n", |
1536 | ENTITY_NAME(con->peer_name), | 1532 | ENTITY_NAME(con->peer_name), |
1537 | ceph_pr_addr(&con->peer_addr.in_addr), | 1533 | ceph_pr_addr(&con->peer_addr.in_addr), |
1538 | seq, con->in_seq + 1); | 1534 | seq, con->in_seq + 1); |
1539 | con->in_base_pos = -front_len - middle_len - data_len - | 1535 | con->in_base_pos = -front_len - middle_len - data_len - |
1540 | sizeof(m->footer); | 1536 | sizeof(m->footer); |
1541 | con->in_tag = CEPH_MSGR_TAG_READY; | 1537 | con->in_tag = CEPH_MSGR_TAG_READY; |
1542 | con->in_seq++; | ||
1543 | return 0; | 1538 | return 0; |
1544 | } else if ((s64)seq - (s64)con->in_seq > 1) { | 1539 | } else if ((s64)seq - (s64)con->in_seq > 1) { |
1545 | pr_err("read_partial_message bad seq %lld expected %lld\n", | 1540 | pr_err("read_partial_message bad seq %lld expected %lld\n", |
@@ -1576,7 +1571,7 @@ static int read_partial_message(struct ceph_connection *con) | |||
1576 | 1571 | ||
1577 | con->in_msg_pos.page = 0; | 1572 | con->in_msg_pos.page = 0; |
1578 | if (m->pages) | 1573 | if (m->pages) |
1579 | con->in_msg_pos.page_pos = data_off & ~PAGE_MASK; | 1574 | con->in_msg_pos.page_pos = m->page_alignment; |
1580 | else | 1575 | else |
1581 | con->in_msg_pos.page_pos = 0; | 1576 | con->in_msg_pos.page_pos = 0; |
1582 | con->in_msg_pos.data_pos = 0; | 1577 | con->in_msg_pos.data_pos = 0; |
@@ -2301,6 +2296,7 @@ struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags) | |||
2301 | 2296 | ||
2302 | /* data */ | 2297 | /* data */ |
2303 | m->nr_pages = 0; | 2298 | m->nr_pages = 0; |
2299 | m->page_alignment = 0; | ||
2304 | m->pages = NULL; | 2300 | m->pages = NULL; |
2305 | m->pagelist = NULL; | 2301 | m->pagelist = NULL; |
2306 | m->bio = NULL; | 2302 | m->bio = NULL; |
@@ -2370,6 +2366,7 @@ static struct ceph_msg *ceph_alloc_msg(struct ceph_connection *con, | |||
2370 | type, front_len); | 2366 | type, front_len); |
2371 | return NULL; | 2367 | return NULL; |
2372 | } | 2368 | } |
2369 | msg->page_alignment = le16_to_cpu(hdr->data_off); | ||
2373 | } | 2370 | } |
2374 | memcpy(&msg->hdr, &con->in_hdr, sizeof(con->in_hdr)); | 2371 | memcpy(&msg->hdr, &con->in_hdr, sizeof(con->in_hdr)); |
2375 | 2372 | ||
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 79391994b3ed..3e20a122ffa2 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -71,6 +71,7 @@ void ceph_calc_raw_layout(struct ceph_osd_client *osdc, | |||
71 | op->extent.length = objlen; | 71 | op->extent.length = objlen; |
72 | } | 72 | } |
73 | req->r_num_pages = calc_pages_for(off, *plen); | 73 | req->r_num_pages = calc_pages_for(off, *plen); |
74 | req->r_page_alignment = off & ~PAGE_MASK; | ||
74 | if (op->op == CEPH_OSD_OP_WRITE) | 75 | if (op->op == CEPH_OSD_OP_WRITE) |
75 | op->payload_len = *plen; | 76 | op->payload_len = *plen; |
76 | 77 | ||
@@ -390,6 +391,8 @@ void ceph_osdc_build_request(struct ceph_osd_request *req, | |||
390 | req->r_request->hdr.data_len = cpu_to_le32(data_len); | 391 | req->r_request->hdr.data_len = cpu_to_le32(data_len); |
391 | } | 392 | } |
392 | 393 | ||
394 | req->r_request->page_alignment = req->r_page_alignment; | ||
395 | |||
393 | BUG_ON(p > msg->front.iov_base + msg->front.iov_len); | 396 | BUG_ON(p > msg->front.iov_base + msg->front.iov_len); |
394 | msg_size = p - msg->front.iov_base; | 397 | msg_size = p - msg->front.iov_base; |
395 | msg->front.iov_len = msg_size; | 398 | msg->front.iov_len = msg_size; |
@@ -419,7 +422,8 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc, | |||
419 | u32 truncate_seq, | 422 | u32 truncate_seq, |
420 | u64 truncate_size, | 423 | u64 truncate_size, |
421 | struct timespec *mtime, | 424 | struct timespec *mtime, |
422 | bool use_mempool, int num_reply) | 425 | bool use_mempool, int num_reply, |
426 | int page_align) | ||
423 | { | 427 | { |
424 | struct ceph_osd_req_op ops[3]; | 428 | struct ceph_osd_req_op ops[3]; |
425 | struct ceph_osd_request *req; | 429 | struct ceph_osd_request *req; |
@@ -447,6 +451,10 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc, | |||
447 | calc_layout(osdc, vino, layout, off, plen, req, ops); | 451 | calc_layout(osdc, vino, layout, off, plen, req, ops); |
448 | req->r_file_layout = *layout; /* keep a copy */ | 452 | req->r_file_layout = *layout; /* keep a copy */ |
449 | 453 | ||
454 | /* in case it differs from natural alignment that calc_layout | ||
455 | filled in for us */ | ||
456 | req->r_page_alignment = page_align; | ||
457 | |||
450 | ceph_osdc_build_request(req, off, plen, ops, | 458 | ceph_osdc_build_request(req, off, plen, ops, |
451 | snapc, | 459 | snapc, |
452 | mtime, | 460 | mtime, |
@@ -1489,7 +1497,7 @@ int ceph_osdc_readpages(struct ceph_osd_client *osdc, | |||
1489 | struct ceph_vino vino, struct ceph_file_layout *layout, | 1497 | struct ceph_vino vino, struct ceph_file_layout *layout, |
1490 | u64 off, u64 *plen, | 1498 | u64 off, u64 *plen, |
1491 | u32 truncate_seq, u64 truncate_size, | 1499 | u32 truncate_seq, u64 truncate_size, |
1492 | struct page **pages, int num_pages) | 1500 | struct page **pages, int num_pages, int page_align) |
1493 | { | 1501 | { |
1494 | struct ceph_osd_request *req; | 1502 | struct ceph_osd_request *req; |
1495 | int rc = 0; | 1503 | int rc = 0; |
@@ -1499,15 +1507,15 @@ int ceph_osdc_readpages(struct ceph_osd_client *osdc, | |||
1499 | req = ceph_osdc_new_request(osdc, layout, vino, off, plen, | 1507 | req = ceph_osdc_new_request(osdc, layout, vino, off, plen, |
1500 | CEPH_OSD_OP_READ, CEPH_OSD_FLAG_READ, | 1508 | CEPH_OSD_OP_READ, CEPH_OSD_FLAG_READ, |
1501 | NULL, 0, truncate_seq, truncate_size, NULL, | 1509 | NULL, 0, truncate_seq, truncate_size, NULL, |
1502 | false, 1); | 1510 | false, 1, page_align); |
1503 | if (!req) | 1511 | if (!req) |
1504 | return -ENOMEM; | 1512 | return -ENOMEM; |
1505 | 1513 | ||
1506 | /* it may be a short read due to an object boundary */ | 1514 | /* it may be a short read due to an object boundary */ |
1507 | req->r_pages = pages; | 1515 | req->r_pages = pages; |
1508 | 1516 | ||
1509 | dout("readpages final extent is %llu~%llu (%d pages)\n", | 1517 | dout("readpages final extent is %llu~%llu (%d pages align %d)\n", |
1510 | off, *plen, req->r_num_pages); | 1518 | off, *plen, req->r_num_pages, page_align); |
1511 | 1519 | ||
1512 | rc = ceph_osdc_start_request(osdc, req, false); | 1520 | rc = ceph_osdc_start_request(osdc, req, false); |
1513 | if (!rc) | 1521 | if (!rc) |
@@ -1533,6 +1541,7 @@ int ceph_osdc_writepages(struct ceph_osd_client *osdc, struct ceph_vino vino, | |||
1533 | { | 1541 | { |
1534 | struct ceph_osd_request *req; | 1542 | struct ceph_osd_request *req; |
1535 | int rc = 0; | 1543 | int rc = 0; |
1544 | int page_align = off & ~PAGE_MASK; | ||
1536 | 1545 | ||
1537 | BUG_ON(vino.snap != CEPH_NOSNAP); | 1546 | BUG_ON(vino.snap != CEPH_NOSNAP); |
1538 | req = ceph_osdc_new_request(osdc, layout, vino, off, &len, | 1547 | req = ceph_osdc_new_request(osdc, layout, vino, off, &len, |
@@ -1541,7 +1550,7 @@ int ceph_osdc_writepages(struct ceph_osd_client *osdc, struct ceph_vino vino, | |||
1541 | CEPH_OSD_FLAG_WRITE, | 1550 | CEPH_OSD_FLAG_WRITE, |
1542 | snapc, do_sync, | 1551 | snapc, do_sync, |
1543 | truncate_seq, truncate_size, mtime, | 1552 | truncate_seq, truncate_size, mtime, |
1544 | nofail, 1); | 1553 | nofail, 1, page_align); |
1545 | if (!req) | 1554 | if (!req) |
1546 | return -ENOMEM; | 1555 | return -ENOMEM; |
1547 | 1556 | ||
@@ -1638,8 +1647,7 @@ static struct ceph_msg *get_reply(struct ceph_connection *con, | |||
1638 | m = ceph_msg_get(req->r_reply); | 1647 | m = ceph_msg_get(req->r_reply); |
1639 | 1648 | ||
1640 | if (data_len > 0) { | 1649 | if (data_len > 0) { |
1641 | unsigned data_off = le16_to_cpu(hdr->data_off); | 1650 | int want = calc_pages_for(req->r_page_alignment, data_len); |
1642 | int want = calc_pages_for(data_off & ~PAGE_MASK, data_len); | ||
1643 | 1651 | ||
1644 | if (unlikely(req->r_num_pages < want)) { | 1652 | if (unlikely(req->r_num_pages < want)) { |
1645 | pr_warning("tid %lld reply %d > expected %d pages\n", | 1653 | pr_warning("tid %lld reply %d > expected %d pages\n", |
@@ -1651,6 +1659,7 @@ static struct ceph_msg *get_reply(struct ceph_connection *con, | |||
1651 | } | 1659 | } |
1652 | m->pages = req->r_pages; | 1660 | m->pages = req->r_pages; |
1653 | m->nr_pages = req->r_num_pages; | 1661 | m->nr_pages = req->r_num_pages; |
1662 | m->page_alignment = req->r_page_alignment; | ||
1654 | #ifdef CONFIG_BLOCK | 1663 | #ifdef CONFIG_BLOCK |
1655 | m->bio = req->r_bio; | 1664 | m->bio = req->r_bio; |
1656 | #endif | 1665 | #endif |
diff --git a/net/ceph/pagevec.c b/net/ceph/pagevec.c index 54caf0687155..1a040e64c69f 100644 --- a/net/ceph/pagevec.c +++ b/net/ceph/pagevec.c | |||
@@ -13,8 +13,7 @@ | |||
13 | * build a vector of user pages | 13 | * build a vector of user pages |
14 | */ | 14 | */ |
15 | struct page **ceph_get_direct_page_vector(const char __user *data, | 15 | struct page **ceph_get_direct_page_vector(const char __user *data, |
16 | int num_pages, | 16 | int num_pages, bool write_page) |
17 | loff_t off, size_t len) | ||
18 | { | 17 | { |
19 | struct page **pages; | 18 | struct page **pages; |
20 | int rc; | 19 | int rc; |
@@ -25,24 +24,27 @@ struct page **ceph_get_direct_page_vector(const char __user *data, | |||
25 | 24 | ||
26 | down_read(¤t->mm->mmap_sem); | 25 | down_read(¤t->mm->mmap_sem); |
27 | rc = get_user_pages(current, current->mm, (unsigned long)data, | 26 | rc = get_user_pages(current, current->mm, (unsigned long)data, |
28 | num_pages, 0, 0, pages, NULL); | 27 | num_pages, write_page, 0, pages, NULL); |
29 | up_read(¤t->mm->mmap_sem); | 28 | up_read(¤t->mm->mmap_sem); |
30 | if (rc < 0) | 29 | if (rc < num_pages) |
31 | goto fail; | 30 | goto fail; |
32 | return pages; | 31 | return pages; |
33 | 32 | ||
34 | fail: | 33 | fail: |
35 | kfree(pages); | 34 | ceph_put_page_vector(pages, rc > 0 ? rc : 0, false); |
36 | return ERR_PTR(rc); | 35 | return ERR_PTR(rc); |
37 | } | 36 | } |
38 | EXPORT_SYMBOL(ceph_get_direct_page_vector); | 37 | EXPORT_SYMBOL(ceph_get_direct_page_vector); |
39 | 38 | ||
40 | void ceph_put_page_vector(struct page **pages, int num_pages) | 39 | void ceph_put_page_vector(struct page **pages, int num_pages, bool dirty) |
41 | { | 40 | { |
42 | int i; | 41 | int i; |
43 | 42 | ||
44 | for (i = 0; i < num_pages; i++) | 43 | for (i = 0; i < num_pages; i++) { |
44 | if (dirty) | ||
45 | set_page_dirty_lock(pages[i]); | ||
45 | put_page(pages[i]); | 46 | put_page(pages[i]); |
47 | } | ||
46 | kfree(pages); | 48 | kfree(pages); |
47 | } | 49 | } |
48 | EXPORT_SYMBOL(ceph_put_page_vector); | 50 | EXPORT_SYMBOL(ceph_put_page_vector); |
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 82a4369ae150..a20e5d3bbfa0 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c | |||
@@ -181,8 +181,7 @@ static int fib_rule_match(struct fib_rule *rule, struct fib_rules_ops *ops, | |||
181 | { | 181 | { |
182 | int ret = 0; | 182 | int ret = 0; |
183 | 183 | ||
184 | if (rule->iifindex && (rule->iifindex != fl->iif) && | 184 | if (rule->iifindex && (rule->iifindex != fl->iif)) |
185 | !(fl->flags & FLOWI_FLAG_MATCH_ANY_IIF)) | ||
186 | goto out; | 185 | goto out; |
187 | 186 | ||
188 | if (rule->oifindex && (rule->oifindex != fl->oif)) | 187 | if (rule->oifindex && (rule->oifindex != fl->oif)) |
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 9f8bb68911e4..1d2cdd43a878 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -159,13 +159,19 @@ struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref) | |||
159 | { | 159 | { |
160 | struct flowi fl = { | 160 | struct flowi fl = { |
161 | .fl4_dst = addr, | 161 | .fl4_dst = addr, |
162 | .flags = FLOWI_FLAG_MATCH_ANY_IIF | ||
163 | }; | 162 | }; |
164 | struct fib_result res = { 0 }; | 163 | struct fib_result res = { 0 }; |
165 | struct net_device *dev = NULL; | 164 | struct net_device *dev = NULL; |
165 | struct fib_table *local_table; | ||
166 | |||
167 | #ifdef CONFIG_IP_MULTIPLE_TABLES | ||
168 | res.r = NULL; | ||
169 | #endif | ||
166 | 170 | ||
167 | rcu_read_lock(); | 171 | rcu_read_lock(); |
168 | if (fib_lookup(net, &fl, &res)) { | 172 | local_table = fib_get_table(net, RT_TABLE_LOCAL); |
173 | if (!local_table || | ||
174 | fib_table_lookup(local_table, &fl, &res, FIB_LOOKUP_NOREF)) { | ||
169 | rcu_read_unlock(); | 175 | rcu_read_unlock(); |
170 | return NULL; | 176 | return NULL; |
171 | } | 177 | } |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index d8b4f4d0d66e..f1defb7d88e8 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2562,9 +2562,10 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp, | |||
2562 | goto out; | 2562 | goto out; |
2563 | 2563 | ||
2564 | /* RACE: Check return value of inet_select_addr instead. */ | 2564 | /* RACE: Check return value of inet_select_addr instead. */ |
2565 | if (rcu_dereference(dev_out->ip_ptr) == NULL) | 2565 | if (!(dev_out->flags & IFF_UP) || !__in_dev_get_rcu(dev_out)) { |
2566 | goto out; /* Wrong error code */ | 2566 | err = -ENETUNREACH; |
2567 | 2567 | goto out; | |
2568 | } | ||
2568 | if (ipv4_is_local_multicast(oldflp->fl4_dst) || | 2569 | if (ipv4_is_local_multicast(oldflp->fl4_dst) || |
2569 | ipv4_is_lbcast(oldflp->fl4_dst)) { | 2570 | ipv4_is_lbcast(oldflp->fl4_dst)) { |
2570 | if (!fl.fl4_src) | 2571 | if (!fl.fl4_src) |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index f4011027543d..856f68466d49 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -2000,7 +2000,7 @@ static void *listening_get_next(struct seq_file *seq, void *cur) | |||
2000 | get_req: | 2000 | get_req: |
2001 | req = icsk->icsk_accept_queue.listen_opt->syn_table[st->sbucket]; | 2001 | req = icsk->icsk_accept_queue.listen_opt->syn_table[st->sbucket]; |
2002 | } | 2002 | } |
2003 | sk = sk_next(st->syn_wait_sk); | 2003 | sk = sk_nulls_next(st->syn_wait_sk); |
2004 | st->state = TCP_SEQ_STATE_LISTENING; | 2004 | st->state = TCP_SEQ_STATE_LISTENING; |
2005 | read_unlock_bh(&icsk->icsk_accept_queue.syn_wait_lock); | 2005 | read_unlock_bh(&icsk->icsk_accept_queue.syn_wait_lock); |
2006 | } else { | 2006 | } else { |
@@ -2009,7 +2009,7 @@ get_req: | |||
2009 | if (reqsk_queue_len(&icsk->icsk_accept_queue)) | 2009 | if (reqsk_queue_len(&icsk->icsk_accept_queue)) |
2010 | goto start_req; | 2010 | goto start_req; |
2011 | read_unlock_bh(&icsk->icsk_accept_queue.syn_wait_lock); | 2011 | read_unlock_bh(&icsk->icsk_accept_queue.syn_wait_lock); |
2012 | sk = sk_next(sk); | 2012 | sk = sk_nulls_next(sk); |
2013 | } | 2013 | } |
2014 | get_sk: | 2014 | get_sk: |
2015 | sk_nulls_for_each_from(sk, node) { | 2015 | sk_nulls_for_each_from(sk, node) { |
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 7f097989cde2..c9890e25cd4c 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c | |||
@@ -45,7 +45,6 @@ | |||
45 | #include <linux/capability.h> | 45 | #include <linux/capability.h> |
46 | #include <linux/module.h> | 46 | #include <linux/module.h> |
47 | #include <linux/types.h> | 47 | #include <linux/types.h> |
48 | #include <linux/smp_lock.h> | ||
49 | #include <linux/socket.h> | 48 | #include <linux/socket.h> |
50 | #include <linux/sockios.h> | 49 | #include <linux/sockios.h> |
51 | #include <linux/slab.h> | 50 | #include <linux/slab.h> |
@@ -2281,6 +2280,16 @@ static int irda_getsockopt(struct socket *sock, int level, int optname, | |||
2281 | 2280 | ||
2282 | switch (optname) { | 2281 | switch (optname) { |
2283 | case IRLMP_ENUMDEVICES: | 2282 | case IRLMP_ENUMDEVICES: |
2283 | |||
2284 | /* Offset to first device entry */ | ||
2285 | offset = sizeof(struct irda_device_list) - | ||
2286 | sizeof(struct irda_device_info); | ||
2287 | |||
2288 | if (len < offset) { | ||
2289 | err = -EINVAL; | ||
2290 | goto out; | ||
2291 | } | ||
2292 | |||
2284 | /* Ask lmp for the current discovery log */ | 2293 | /* Ask lmp for the current discovery log */ |
2285 | discoveries = irlmp_get_discoveries(&list.len, self->mask.word, | 2294 | discoveries = irlmp_get_discoveries(&list.len, self->mask.word, |
2286 | self->nslots); | 2295 | self->nslots); |
@@ -2291,15 +2300,9 @@ static int irda_getsockopt(struct socket *sock, int level, int optname, | |||
2291 | } | 2300 | } |
2292 | 2301 | ||
2293 | /* Write total list length back to client */ | 2302 | /* Write total list length back to client */ |
2294 | if (copy_to_user(optval, &list, | 2303 | if (copy_to_user(optval, &list, offset)) |
2295 | sizeof(struct irda_device_list) - | ||
2296 | sizeof(struct irda_device_info))) | ||
2297 | err = -EFAULT; | 2304 | err = -EFAULT; |
2298 | 2305 | ||
2299 | /* Offset to first device entry */ | ||
2300 | offset = sizeof(struct irda_device_list) - | ||
2301 | sizeof(struct irda_device_info); | ||
2302 | |||
2303 | /* Copy the list itself - watch for overflow */ | 2306 | /* Copy the list itself - watch for overflow */ |
2304 | if (list.len > 2048) { | 2307 | if (list.len > 2048) { |
2305 | err = -EINVAL; | 2308 | err = -EINVAL; |
diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c index 7fa86373de41..7c567b8aa89a 100644 --- a/net/irda/irnet/irnet_ppp.c +++ b/net/irda/irnet/irnet_ppp.c | |||
@@ -15,7 +15,6 @@ | |||
15 | 15 | ||
16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
18 | #include <linux/smp_lock.h> | ||
19 | #include "irnet_ppp.h" /* Private header */ | 18 | #include "irnet_ppp.h" /* Private header */ |
20 | /* Please put other headers in irnet.h - Thanks */ | 19 | /* Please put other headers in irnet.h - Thanks */ |
21 | 20 | ||
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig index 798d9b9462e2..9109262abd24 100644 --- a/net/mac80211/Kconfig +++ b/net/mac80211/Kconfig | |||
@@ -93,7 +93,7 @@ config MAC80211_MESH | |||
93 | config MAC80211_LEDS | 93 | config MAC80211_LEDS |
94 | bool "Enable LED triggers" | 94 | bool "Enable LED triggers" |
95 | depends on MAC80211 | 95 | depends on MAC80211 |
96 | select NEW_LEDS | 96 | depends on LEDS_CLASS |
97 | select LEDS_TRIGGERS | 97 | select LEDS_TRIGGERS |
98 | ---help--- | 98 | ---help--- |
99 | This option enables a few LED triggers for different | 99 | This option enables a few LED triggers for different |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 01a3f2630eaf..5e9d3bc6a2d9 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1831,9 +1831,11 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) | |||
1831 | 1831 | ||
1832 | fwd_skb = skb_copy(skb, GFP_ATOMIC); | 1832 | fwd_skb = skb_copy(skb, GFP_ATOMIC); |
1833 | 1833 | ||
1834 | if (!fwd_skb && net_ratelimit()) | 1834 | if (!fwd_skb && net_ratelimit()) { |
1835 | printk(KERN_DEBUG "%s: failed to clone mesh frame\n", | 1835 | printk(KERN_DEBUG "%s: failed to clone mesh frame\n", |
1836 | sdata->name); | 1836 | sdata->name); |
1837 | goto out; | ||
1838 | } | ||
1837 | 1839 | ||
1838 | fwd_hdr = (struct ieee80211_hdr *) fwd_skb->data; | 1840 | fwd_hdr = (struct ieee80211_hdr *) fwd_skb->data; |
1839 | memcpy(fwd_hdr->addr2, sdata->vif.addr, ETH_ALEN); | 1841 | memcpy(fwd_hdr->addr2, sdata->vif.addr, ETH_ALEN); |
@@ -1871,6 +1873,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) | |||
1871 | } | 1873 | } |
1872 | } | 1874 | } |
1873 | 1875 | ||
1876 | out: | ||
1874 | if (is_multicast_ether_addr(hdr->addr1) || | 1877 | if (is_multicast_ether_addr(hdr->addr1) || |
1875 | sdata->dev->flags & IFF_PROMISC) | 1878 | sdata->dev->flags & IFF_PROMISC) |
1876 | return RX_CONTINUE; | 1879 | return RX_CONTINUE; |
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 9dab9573be41..92ce94f5146b 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -989,20 +989,26 @@ call_refreshresult(struct rpc_task *task) | |||
989 | dprint_status(task); | 989 | dprint_status(task); |
990 | 990 | ||
991 | task->tk_status = 0; | 991 | task->tk_status = 0; |
992 | task->tk_action = call_allocate; | 992 | task->tk_action = call_refresh; |
993 | if (status >= 0 && rpcauth_uptodatecred(task)) | ||
994 | return; | ||
995 | switch (status) { | 993 | switch (status) { |
996 | case -EACCES: | 994 | case 0: |
997 | rpc_exit(task, -EACCES); | 995 | if (rpcauth_uptodatecred(task)) |
998 | return; | 996 | task->tk_action = call_allocate; |
999 | case -ENOMEM: | ||
1000 | rpc_exit(task, -ENOMEM); | ||
1001 | return; | 997 | return; |
1002 | case -ETIMEDOUT: | 998 | case -ETIMEDOUT: |
1003 | rpc_delay(task, 3*HZ); | 999 | rpc_delay(task, 3*HZ); |
1000 | case -EAGAIN: | ||
1001 | status = -EACCES; | ||
1002 | if (!task->tk_cred_retry) | ||
1003 | break; | ||
1004 | task->tk_cred_retry--; | ||
1005 | dprintk("RPC: %5u %s: retry refresh creds\n", | ||
1006 | task->tk_pid, __func__); | ||
1007 | return; | ||
1004 | } | 1008 | } |
1005 | task->tk_action = call_refresh; | 1009 | dprintk("RPC: %5u %s: refresh creds failed with error %d\n", |
1010 | task->tk_pid, __func__, status); | ||
1011 | rpc_exit(task, status); | ||
1006 | } | 1012 | } |
1007 | 1013 | ||
1008 | /* | 1014 | /* |
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index f71a73107ae9..80df89d957ba 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c | |||
@@ -115,9 +115,7 @@ EXPORT_SYMBOL_GPL(svc_seq_show); | |||
115 | */ | 115 | */ |
116 | struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) | 116 | struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) |
117 | { | 117 | { |
118 | struct rpc_iostats *new; | 118 | return kcalloc(clnt->cl_maxproc, sizeof(struct rpc_iostats), GFP_KERNEL); |
119 | new = kcalloc(clnt->cl_maxproc, sizeof(struct rpc_iostats), GFP_KERNEL); | ||
120 | return new; | ||
121 | } | 119 | } |
122 | EXPORT_SYMBOL_GPL(rpc_alloc_iostats); | 120 | EXPORT_SYMBOL_GPL(rpc_alloc_iostats); |
123 | 121 | ||
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index c82fe739fbdc..3f2c5559ca1a 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -5,7 +5,6 @@ | |||
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
8 | #include <linux/smp_lock.h> | ||
9 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
10 | #include <linux/freezer.h> | 9 | #include <linux/freezer.h> |
11 | #include <linux/kthread.h> | 10 | #include <linux/kthread.h> |
@@ -213,6 +212,7 @@ int svc_create_xprt(struct svc_serv *serv, const char *xprt_name, | |||
213 | spin_lock(&svc_xprt_class_lock); | 212 | spin_lock(&svc_xprt_class_lock); |
214 | list_for_each_entry(xcl, &svc_xprt_class_list, xcl_list) { | 213 | list_for_each_entry(xcl, &svc_xprt_class_list, xcl_list) { |
215 | struct svc_xprt *newxprt; | 214 | struct svc_xprt *newxprt; |
215 | unsigned short newport; | ||
216 | 216 | ||
217 | if (strcmp(xprt_name, xcl->xcl_name)) | 217 | if (strcmp(xprt_name, xcl->xcl_name)) |
218 | continue; | 218 | continue; |
@@ -231,8 +231,9 @@ int svc_create_xprt(struct svc_serv *serv, const char *xprt_name, | |||
231 | spin_lock_bh(&serv->sv_lock); | 231 | spin_lock_bh(&serv->sv_lock); |
232 | list_add(&newxprt->xpt_list, &serv->sv_permsocks); | 232 | list_add(&newxprt->xpt_list, &serv->sv_permsocks); |
233 | spin_unlock_bh(&serv->sv_lock); | 233 | spin_unlock_bh(&serv->sv_lock); |
234 | newport = svc_xprt_local_port(newxprt); | ||
234 | clear_bit(XPT_BUSY, &newxprt->xpt_flags); | 235 | clear_bit(XPT_BUSY, &newxprt->xpt_flags); |
235 | return svc_xprt_local_port(newxprt); | 236 | return newport; |
236 | } | 237 | } |
237 | err: | 238 | err: |
238 | spin_unlock(&svc_xprt_class_lock); | 239 | spin_unlock(&svc_xprt_class_lock); |
@@ -426,8 +427,13 @@ void svc_xprt_received(struct svc_xprt *xprt) | |||
426 | { | 427 | { |
427 | BUG_ON(!test_bit(XPT_BUSY, &xprt->xpt_flags)); | 428 | BUG_ON(!test_bit(XPT_BUSY, &xprt->xpt_flags)); |
428 | xprt->xpt_pool = NULL; | 429 | xprt->xpt_pool = NULL; |
430 | /* As soon as we clear busy, the xprt could be closed and | ||
431 | * 'put', so we need a reference to call svc_xprt_enqueue with: | ||
432 | */ | ||
433 | svc_xprt_get(xprt); | ||
429 | clear_bit(XPT_BUSY, &xprt->xpt_flags); | 434 | clear_bit(XPT_BUSY, &xprt->xpt_flags); |
430 | svc_xprt_enqueue(xprt); | 435 | svc_xprt_enqueue(xprt); |
436 | svc_xprt_put(xprt); | ||
431 | } | 437 | } |
432 | EXPORT_SYMBOL_GPL(svc_xprt_received); | 438 | EXPORT_SYMBOL_GPL(svc_xprt_received); |
433 | 439 | ||