summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-03-04 22:29:57 -0600
committerSage Weil <sage@inktank.com>2013-05-01 21:16:41 -0700
commitebf18f47093e968105767eed4a0aa155e86b224e (patch)
tree90122481017a894850e46b8c86987bd31548fddc /fs
parent27fa83852ba275361eaa1a1283cf6704fa8191a6 (diff)
downloadlinux-ebf18f47093e968105767eed4a0aa155e86b224e.tar.bz2
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')
-rw-r--r--fs/ceph/mds_client.c13
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,
msg->front.iov_len = p - msg->front.iov_base;
msg->hdr.front_len = cpu_to_le32(msg->front.iov_len);
- ceph_msg_data_set_pages(msg, req->r_pages, req->r_data_len, 0);
+ if (req->r_data_len) {
+ /* outbound data set only by ceph_sync_setxattr() */
+ BUG_ON(!req->r_pages);
+ ceph_msg_data_set_pages(msg, req->r_pages, req->r_data_len, 0);
+ }
msg->hdr.data_len = cpu_to_le32(req->r_data_len);
msg->hdr.data_off = cpu_to_le16(0);
@@ -2603,10 +2607,13 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc,
goto fail;
}
- ceph_msg_data_set_pagelist(reply, pagelist);
if (recon_state.flock)
reply->hdr.version = cpu_to_le16(2);
- reply->hdr.data_len = cpu_to_le32(pagelist->length);
+ if (pagelist->length) {
+ /* set up outbound data if we have any */
+ reply->hdr.data_len = cpu_to_le32(pagelist->length);
+ ceph_msg_data_set_pagelist(reply, pagelist);
+ }
ceph_con_send(&session->s_con, reply);
mutex_unlock(&session->s_mutex);