aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/osd_client.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-03-04 23:29:57 -0500
committerSage Weil <sage@inktank.com>2013-05-02 00:16:41 -0400
commitebf18f47093e968105767eed4a0aa155e86b224e (patch)
tree90122481017a894850e46b8c86987bd31548fddc /net/ceph/osd_client.c
parent27fa83852ba275361eaa1a1283cf6704fa8191a6 (diff)
ceph: only set message data pointers if non-empty
Change it so we only assign outgoing data information for messages if there is outgoing data to send. This then allows us to add a few more (currently commented-out) assertions. This is related to: http://tracker.ceph.com/issues/4284 Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Greg Farnum <greg@inktank.com>
Diffstat (limited to 'net/ceph/osd_client.c')
-rw-r--r--net/ceph/osd_client.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 387e3123d1ed..4402e917b9b1 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -1759,8 +1759,10 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc,
1759 osd_data = &req->r_data_out; 1759 osd_data = &req->r_data_out;
1760 if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGES) { 1760 if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGES) {
1761 BUG_ON(osd_data->length > (u64) SIZE_MAX); 1761 BUG_ON(osd_data->length > (u64) SIZE_MAX);
1762 ceph_msg_data_set_pages(req->r_request, osd_data->pages, 1762 if (osd_data->length)
1763 osd_data->length, osd_data->alignment); 1763 ceph_msg_data_set_pages(req->r_request,
1764 osd_data->pages, osd_data->length,
1765 osd_data->alignment);
1764#ifdef CONFIG_BLOCK 1766#ifdef CONFIG_BLOCK
1765 } else if (osd_data->type == CEPH_OSD_DATA_TYPE_BIO) { 1767 } else if (osd_data->type == CEPH_OSD_DATA_TYPE_BIO) {
1766 ceph_msg_data_set_bio(req->r_request, osd_data->bio); 1768 ceph_msg_data_set_bio(req->r_request, osd_data->bio);
@@ -1768,7 +1770,8 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc,
1768 } else { 1770 } else {
1769 BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_NONE); 1771 BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_NONE);
1770 } 1772 }
1771 ceph_msg_data_set_trail(req->r_request, &req->r_trail); 1773 if (req->r_trail.length)
1774 ceph_msg_data_set_trail(req->r_request, &req->r_trail);
1772 1775
1773 register_request(osdc, req); 1776 register_request(osdc, req);
1774 1777