From ebf18f47093e968105767eed4a0aa155e86b224e Mon Sep 17 00:00:00 2001 From: Alex Elder Date: Mon, 4 Mar 2013 22:29:57 -0600 Subject: 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 Reviewed-by: Greg Farnum --- net/ceph/osd_client.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'net/ceph/osd_client.c') 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, osd_data = &req->r_data_out; if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGES) { BUG_ON(osd_data->length > (u64) SIZE_MAX); - ceph_msg_data_set_pages(req->r_request, osd_data->pages, - osd_data->length, osd_data->alignment); + if (osd_data->length) + ceph_msg_data_set_pages(req->r_request, + osd_data->pages, osd_data->length, + osd_data->alignment); #ifdef CONFIG_BLOCK } else if (osd_data->type == CEPH_OSD_DATA_TYPE_BIO) { 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, } else { BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_NONE); } - ceph_msg_data_set_trail(req->r_request, &req->r_trail); + if (req->r_trail.length) + ceph_msg_data_set_trail(req->r_request, &req->r_trail); register_request(osdc, req); -- cgit v1.2.3