diff options
Diffstat (limited to 'net/ceph/osd_client.c')
-rw-r--r-- | net/ceph/osd_client.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 6ea2b892f44..7330c2757c0 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -477,8 +477,9 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc, | |||
477 | calc_layout(osdc, vino, layout, off, plen, req, ops); | 477 | calc_layout(osdc, vino, layout, off, plen, req, ops); |
478 | req->r_file_layout = *layout; /* keep a copy */ | 478 | req->r_file_layout = *layout; /* keep a copy */ |
479 | 479 | ||
480 | /* in case it differs from natural alignment that calc_layout | 480 | /* in case it differs from natural (file) alignment that |
481 | filled in for us */ | 481 | calc_layout filled in for us */ |
482 | req->r_num_pages = calc_pages_for(page_align, *plen); | ||
482 | req->r_page_alignment = page_align; | 483 | req->r_page_alignment = page_align; |
483 | 484 | ||
484 | ceph_osdc_build_request(req, off, plen, ops, | 485 | ceph_osdc_build_request(req, off, plen, ops, |
@@ -1144,6 +1145,13 @@ static void handle_osds_timeout(struct work_struct *work) | |||
1144 | round_jiffies_relative(delay)); | 1145 | round_jiffies_relative(delay)); |
1145 | } | 1146 | } |
1146 | 1147 | ||
1148 | static void complete_request(struct ceph_osd_request *req) | ||
1149 | { | ||
1150 | if (req->r_safe_callback) | ||
1151 | req->r_safe_callback(req, NULL); | ||
1152 | complete_all(&req->r_safe_completion); /* fsync waiter */ | ||
1153 | } | ||
1154 | |||
1147 | /* | 1155 | /* |
1148 | * handle osd op reply. either call the callback if it is specified, | 1156 | * handle osd op reply. either call the callback if it is specified, |
1149 | * or do the completion to wake up the waiting thread. | 1157 | * or do the completion to wake up the waiting thread. |
@@ -1226,11 +1234,8 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg, | |||
1226 | else | 1234 | else |
1227 | complete_all(&req->r_completion); | 1235 | complete_all(&req->r_completion); |
1228 | 1236 | ||
1229 | if (flags & CEPH_OSD_FLAG_ONDISK) { | 1237 | if (flags & CEPH_OSD_FLAG_ONDISK) |
1230 | if (req->r_safe_callback) | 1238 | complete_request(req); |
1231 | req->r_safe_callback(req, msg); | ||
1232 | complete_all(&req->r_safe_completion); /* fsync waiter */ | ||
1233 | } | ||
1234 | 1239 | ||
1235 | done: | 1240 | done: |
1236 | dout("req=%p req->r_linger=%d\n", req, req->r_linger); | 1241 | dout("req=%p req->r_linger=%d\n", req, req->r_linger); |
@@ -1732,6 +1737,7 @@ int ceph_osdc_wait_request(struct ceph_osd_client *osdc, | |||
1732 | __cancel_request(req); | 1737 | __cancel_request(req); |
1733 | __unregister_request(osdc, req); | 1738 | __unregister_request(osdc, req); |
1734 | mutex_unlock(&osdc->request_mutex); | 1739 | mutex_unlock(&osdc->request_mutex); |
1740 | complete_request(req); | ||
1735 | dout("wait_request tid %llu canceled/timed out\n", req->r_tid); | 1741 | dout("wait_request tid %llu canceled/timed out\n", req->r_tid); |
1736 | return rc; | 1742 | return rc; |
1737 | } | 1743 | } |
@@ -2022,8 +2028,9 @@ static struct ceph_msg *get_reply(struct ceph_connection *con, | |||
2022 | int want = calc_pages_for(req->r_page_alignment, data_len); | 2028 | int want = calc_pages_for(req->r_page_alignment, data_len); |
2023 | 2029 | ||
2024 | if (unlikely(req->r_num_pages < want)) { | 2030 | if (unlikely(req->r_num_pages < want)) { |
2025 | pr_warning("tid %lld reply %d > expected %d pages\n", | 2031 | pr_warning("tid %lld reply has %d bytes %d pages, we" |
2026 | tid, want, m->nr_pages); | 2032 | " had only %d pages ready\n", tid, data_len, |
2033 | want, req->r_num_pages); | ||
2027 | *skip = 1; | 2034 | *skip = 1; |
2028 | ceph_msg_put(m); | 2035 | ceph_msg_put(m); |
2029 | m = NULL; | 2036 | m = NULL; |