diff options
author | Alex Elder <elder@inktank.com> | 2013-03-04 23:29:57 -0500 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 00:16:41 -0400 |
commit | ebf18f47093e968105767eed4a0aa155e86b224e (patch) | |
tree | 90122481017a894850e46b8c86987bd31548fddc /fs/ceph/mds_client.c | |
parent | 27fa83852ba275361eaa1a1283cf6704fa8191a6 (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 'fs/ceph/mds_client.c')
-rw-r--r-- | fs/ceph/mds_client.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 3b2aa8702ae0..600d770d70f7 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -1721,7 +1721,11 @@ static struct ceph_msg *create_request_message(struct ceph_mds_client *mdsc, | |||
1721 | msg->front.iov_len = p - msg->front.iov_base; | 1721 | msg->front.iov_len = p - msg->front.iov_base; |
1722 | msg->hdr.front_len = cpu_to_le32(msg->front.iov_len); | 1722 | msg->hdr.front_len = cpu_to_le32(msg->front.iov_len); |
1723 | 1723 | ||
1724 | ceph_msg_data_set_pages(msg, req->r_pages, req->r_data_len, 0); | 1724 | if (req->r_data_len) { |
1725 | /* outbound data set only by ceph_sync_setxattr() */ | ||
1726 | BUG_ON(!req->r_pages); | ||
1727 | ceph_msg_data_set_pages(msg, req->r_pages, req->r_data_len, 0); | ||
1728 | } | ||
1725 | 1729 | ||
1726 | msg->hdr.data_len = cpu_to_le32(req->r_data_len); | 1730 | msg->hdr.data_len = cpu_to_le32(req->r_data_len); |
1727 | msg->hdr.data_off = cpu_to_le16(0); | 1731 | msg->hdr.data_off = cpu_to_le16(0); |
@@ -2603,10 +2607,13 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc, | |||
2603 | goto fail; | 2607 | goto fail; |
2604 | } | 2608 | } |
2605 | 2609 | ||
2606 | ceph_msg_data_set_pagelist(reply, pagelist); | ||
2607 | if (recon_state.flock) | 2610 | if (recon_state.flock) |
2608 | reply->hdr.version = cpu_to_le16(2); | 2611 | reply->hdr.version = cpu_to_le16(2); |
2609 | reply->hdr.data_len = cpu_to_le32(pagelist->length); | 2612 | if (pagelist->length) { |
2613 | /* set up outbound data if we have any */ | ||
2614 | reply->hdr.data_len = cpu_to_le32(pagelist->length); | ||
2615 | ceph_msg_data_set_pagelist(reply, pagelist); | ||
2616 | } | ||
2610 | ceph_con_send(&session->s_con, reply); | 2617 | ceph_con_send(&session->s_con, reply); |
2611 | 2618 | ||
2612 | mutex_unlock(&session->s_mutex); | 2619 | mutex_unlock(&session->s_mutex); |