aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-01-31 17:02:00 -0500
committerSage Weil <sage@inktank.com>2013-02-13 21:29:11 -0500
commit9cbb1d7268afa997a7f96d779470cc57d28e1a13 (patch)
tree573dfaa8590be939671c73d3536fe031094d1b2e /net
parent1e32d34cfa6759df58b5f4002664241f2a0fef6a (diff)
libceph: don't require r_num_pages for bio requests
There is a check in the completion path for osd requests that ensures the number of pages allocated is enough to hold the amount of incoming data expected. For bio requests coming from rbd the "number of pages" is not really meaningful (although total length would be). So stop requiring that nr_pages be supplied for bio requests. This is done by checking whether the pages pointer is null before checking the value of nr_pages. Note that this value is passed on to the messenger, but there it's only used for debugging--it's never used for validation. While here, change another spot that used r_pages in a debug message inappropriately, and also invalidate the r_con_filling_msg pointer after dropping a reference to it. This resolves: http://tracker.ceph.com/issues/3875 Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'net')
-rw-r--r--net/ceph/osd_client.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index ba03648533c0..d9d58bbe9f9a 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -137,10 +137,11 @@ void ceph_osdc_release_request(struct kref *kref)
137 if (req->r_request) 137 if (req->r_request)
138 ceph_msg_put(req->r_request); 138 ceph_msg_put(req->r_request);
139 if (req->r_con_filling_msg) { 139 if (req->r_con_filling_msg) {
140 dout("%s revoking pages %p from con %p\n", __func__, 140 dout("%s revoking msg %p from con %p\n", __func__,
141 req->r_pages, req->r_con_filling_msg); 141 req->r_reply, req->r_con_filling_msg);
142 ceph_msg_revoke_incoming(req->r_reply); 142 ceph_msg_revoke_incoming(req->r_reply);
143 req->r_con_filling_msg->ops->put(req->r_con_filling_msg); 143 req->r_con_filling_msg->ops->put(req->r_con_filling_msg);
144 req->r_con_filling_msg = NULL;
144 } 145 }
145 if (req->r_reply) 146 if (req->r_reply)
146 ceph_msg_put(req->r_reply); 147 ceph_msg_put(req->r_reply);
@@ -1981,7 +1982,7 @@ static struct ceph_msg *get_reply(struct ceph_connection *con,
1981 if (data_len > 0) { 1982 if (data_len > 0) {
1982 int want = calc_pages_for(req->r_page_alignment, data_len); 1983 int want = calc_pages_for(req->r_page_alignment, data_len);
1983 1984
1984 if (unlikely(req->r_num_pages < want)) { 1985 if (req->r_pages && unlikely(req->r_num_pages < want)) {
1985 pr_warning("tid %lld reply has %d bytes %d pages, we" 1986 pr_warning("tid %lld reply has %d bytes %d pages, we"
1986 " had only %d pages ready\n", tid, data_len, 1987 " had only %d pages ready\n", tid, data_len,
1987 want, req->r_num_pages); 1988 want, req->r_num_pages);