diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ceph/messenger.c | 2 | ||||
-rw-r--r-- | net/ceph/osd_client.c | 27 | ||||
-rw-r--r-- | net/ceph/osdmap.c | 2 |
3 files changed, 20 insertions, 11 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index eb0a46a49bd4..dd9b5857ef5c 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -290,7 +290,7 @@ int ceph_msgr_init(void) | |||
290 | if (ceph_msgr_slab_init()) | 290 | if (ceph_msgr_slab_init()) |
291 | return -ENOMEM; | 291 | return -ENOMEM; |
292 | 292 | ||
293 | ceph_msgr_wq = alloc_workqueue("ceph-msgr", WQ_NON_REENTRANT, 0); | 293 | ceph_msgr_wq = alloc_workqueue("ceph-msgr", 0, 0); |
294 | if (ceph_msgr_wq) | 294 | if (ceph_msgr_wq) |
295 | return 0; | 295 | return 0; |
296 | 296 | ||
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index dd47889adc4a..1606f740d6ae 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -503,7 +503,9 @@ void osd_req_op_extent_init(struct ceph_osd_request *osd_req, | |||
503 | struct ceph_osd_req_op *op = _osd_req_op_init(osd_req, which, opcode); | 503 | struct ceph_osd_req_op *op = _osd_req_op_init(osd_req, which, opcode); |
504 | size_t payload_len = 0; | 504 | size_t payload_len = 0; |
505 | 505 | ||
506 | BUG_ON(opcode != CEPH_OSD_OP_READ && opcode != CEPH_OSD_OP_WRITE); | 506 | BUG_ON(opcode != CEPH_OSD_OP_READ && opcode != CEPH_OSD_OP_WRITE && |
507 | opcode != CEPH_OSD_OP_DELETE && opcode != CEPH_OSD_OP_ZERO && | ||
508 | opcode != CEPH_OSD_OP_TRUNCATE); | ||
507 | 509 | ||
508 | op->extent.offset = offset; | 510 | op->extent.offset = offset; |
509 | op->extent.length = length; | 511 | op->extent.length = length; |
@@ -631,6 +633,9 @@ static u64 osd_req_encode_op(struct ceph_osd_request *req, | |||
631 | break; | 633 | break; |
632 | case CEPH_OSD_OP_READ: | 634 | case CEPH_OSD_OP_READ: |
633 | case CEPH_OSD_OP_WRITE: | 635 | case CEPH_OSD_OP_WRITE: |
636 | case CEPH_OSD_OP_ZERO: | ||
637 | case CEPH_OSD_OP_DELETE: | ||
638 | case CEPH_OSD_OP_TRUNCATE: | ||
634 | if (src->op == CEPH_OSD_OP_WRITE) | 639 | if (src->op == CEPH_OSD_OP_WRITE) |
635 | request_data_len = src->extent.length; | 640 | request_data_len = src->extent.length; |
636 | dst->extent.offset = cpu_to_le64(src->extent.offset); | 641 | dst->extent.offset = cpu_to_le64(src->extent.offset); |
@@ -715,7 +720,9 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc, | |||
715 | u64 object_base; | 720 | u64 object_base; |
716 | int r; | 721 | int r; |
717 | 722 | ||
718 | BUG_ON(opcode != CEPH_OSD_OP_READ && opcode != CEPH_OSD_OP_WRITE); | 723 | BUG_ON(opcode != CEPH_OSD_OP_READ && opcode != CEPH_OSD_OP_WRITE && |
724 | opcode != CEPH_OSD_OP_DELETE && opcode != CEPH_OSD_OP_ZERO && | ||
725 | opcode != CEPH_OSD_OP_TRUNCATE); | ||
719 | 726 | ||
720 | req = ceph_osdc_alloc_request(osdc, snapc, num_ops, use_mempool, | 727 | req = ceph_osdc_alloc_request(osdc, snapc, num_ops, use_mempool, |
721 | GFP_NOFS); | 728 | GFP_NOFS); |
@@ -1488,14 +1495,14 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg, | |||
1488 | dout("handle_reply %p tid %llu req %p result %d\n", msg, tid, | 1495 | dout("handle_reply %p tid %llu req %p result %d\n", msg, tid, |
1489 | req, result); | 1496 | req, result); |
1490 | 1497 | ||
1491 | ceph_decode_need(&p, end, 4, bad); | 1498 | ceph_decode_need(&p, end, 4, bad_put); |
1492 | numops = ceph_decode_32(&p); | 1499 | numops = ceph_decode_32(&p); |
1493 | if (numops > CEPH_OSD_MAX_OP) | 1500 | if (numops > CEPH_OSD_MAX_OP) |
1494 | goto bad_put; | 1501 | goto bad_put; |
1495 | if (numops != req->r_num_ops) | 1502 | if (numops != req->r_num_ops) |
1496 | goto bad_put; | 1503 | goto bad_put; |
1497 | payload_len = 0; | 1504 | payload_len = 0; |
1498 | ceph_decode_need(&p, end, numops * sizeof(struct ceph_osd_op), bad); | 1505 | ceph_decode_need(&p, end, numops * sizeof(struct ceph_osd_op), bad_put); |
1499 | for (i = 0; i < numops; i++) { | 1506 | for (i = 0; i < numops; i++) { |
1500 | struct ceph_osd_op *op = p; | 1507 | struct ceph_osd_op *op = p; |
1501 | int len; | 1508 | int len; |
@@ -1513,7 +1520,7 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg, | |||
1513 | goto bad_put; | 1520 | goto bad_put; |
1514 | } | 1521 | } |
1515 | 1522 | ||
1516 | ceph_decode_need(&p, end, 4 + numops * 4, bad); | 1523 | ceph_decode_need(&p, end, 4 + numops * 4, bad_put); |
1517 | retry_attempt = ceph_decode_32(&p); | 1524 | retry_attempt = ceph_decode_32(&p); |
1518 | for (i = 0; i < numops; i++) | 1525 | for (i = 0; i < numops; i++) |
1519 | req->r_reply_op_result[i] = ceph_decode_32(&p); | 1526 | req->r_reply_op_result[i] = ceph_decode_32(&p); |
@@ -1786,6 +1793,8 @@ void ceph_osdc_handle_map(struct ceph_osd_client *osdc, struct ceph_msg *msg) | |||
1786 | nr_maps--; | 1793 | nr_maps--; |
1787 | } | 1794 | } |
1788 | 1795 | ||
1796 | if (!osdc->osdmap) | ||
1797 | goto bad; | ||
1789 | done: | 1798 | done: |
1790 | downgrade_write(&osdc->map_sem); | 1799 | downgrade_write(&osdc->map_sem); |
1791 | ceph_monc_got_osdmap(&osdc->client->monc, osdc->osdmap->epoch); | 1800 | ceph_monc_got_osdmap(&osdc->client->monc, osdc->osdmap->epoch); |
@@ -2129,6 +2138,8 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc, | |||
2129 | dout("osdc_start_request failed map, " | 2138 | dout("osdc_start_request failed map, " |
2130 | " will retry %lld\n", req->r_tid); | 2139 | " will retry %lld\n", req->r_tid); |
2131 | rc = 0; | 2140 | rc = 0; |
2141 | } else { | ||
2142 | __unregister_request(osdc, req); | ||
2132 | } | 2143 | } |
2133 | goto out_unlock; | 2144 | goto out_unlock; |
2134 | } | 2145 | } |
@@ -2253,12 +2264,10 @@ int ceph_osdc_init(struct ceph_osd_client *osdc, struct ceph_client *client) | |||
2253 | if (err < 0) | 2264 | if (err < 0) |
2254 | goto out_msgpool; | 2265 | goto out_msgpool; |
2255 | 2266 | ||
2267 | err = -ENOMEM; | ||
2256 | osdc->notify_wq = create_singlethread_workqueue("ceph-watch-notify"); | 2268 | osdc->notify_wq = create_singlethread_workqueue("ceph-watch-notify"); |
2257 | if (IS_ERR(osdc->notify_wq)) { | 2269 | if (!osdc->notify_wq) |
2258 | err = PTR_ERR(osdc->notify_wq); | ||
2259 | osdc->notify_wq = NULL; | ||
2260 | goto out_msgpool; | 2270 | goto out_msgpool; |
2261 | } | ||
2262 | return 0; | 2271 | return 0; |
2263 | 2272 | ||
2264 | out_msgpool: | 2273 | out_msgpool: |
diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c index 603ddd92db19..dbd9a4792427 100644 --- a/net/ceph/osdmap.c +++ b/net/ceph/osdmap.c | |||
@@ -1129,7 +1129,7 @@ static int *calc_pg_raw(struct ceph_osdmap *osdmap, struct ceph_pg pgid, | |||
1129 | 1129 | ||
1130 | /* pg_temp? */ | 1130 | /* pg_temp? */ |
1131 | pgid.seed = ceph_stable_mod(pgid.seed, pool->pg_num, | 1131 | pgid.seed = ceph_stable_mod(pgid.seed, pool->pg_num, |
1132 | pool->pgp_num_mask); | 1132 | pool->pg_num_mask); |
1133 | pg = __lookup_pg_mapping(&osdmap->pg_temp, pgid); | 1133 | pg = __lookup_pg_mapping(&osdmap->pg_temp, pgid); |
1134 | if (pg) { | 1134 | if (pg) { |
1135 | *num = pg->len; | 1135 | *num = pg->len; |