aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-06-11 15:57:13 -0400
committerSage Weil <sage@inktank.com>2012-07-06 00:14:13 -0400
commitfd154f3c75465abd83b7a395033e3755908a1e6e (patch)
treee3b386cd2bf33c687cdac4ef45bf8a063a7049d0 /net
parent84ca8fc87fcf4ab97bb8acdb59bf97bb4820cb14 (diff)
libceph: don't mark footer complete before it is
This is a nit, but prepare_write_message() sets the FOOTER_COMPLETE flag before the CRC for the data portion (recorded in the footer) has been completely computed. Hold off setting the complete flag until we've decided it's ready to send. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net')
-rw-r--r--net/ceph/messenger.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 1b92e3b16c0d..5354d59ba8b9 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -592,6 +592,8 @@ static void prepare_write_message_footer(struct ceph_connection *con)
592 struct ceph_msg *m = con->out_msg; 592 struct ceph_msg *m = con->out_msg;
593 int v = con->out_kvec_left; 593 int v = con->out_kvec_left;
594 594
595 m->footer.flags |= CEPH_MSG_FOOTER_COMPLETE;
596
595 dout("prepare_write_message_footer %p\n", con); 597 dout("prepare_write_message_footer %p\n", con);
596 con->out_kvec_is_msg = true; 598 con->out_kvec_is_msg = true;
597 con->out_kvec[v].iov_base = &m->footer; 599 con->out_kvec[v].iov_base = &m->footer;
@@ -665,7 +667,7 @@ static void prepare_write_message(struct ceph_connection *con)
665 /* fill in crc (except data pages), footer */ 667 /* fill in crc (except data pages), footer */
666 crc = crc32c(0, &m->hdr, offsetof(struct ceph_msg_header, crc)); 668 crc = crc32c(0, &m->hdr, offsetof(struct ceph_msg_header, crc));
667 con->out_msg->hdr.crc = cpu_to_le32(crc); 669 con->out_msg->hdr.crc = cpu_to_le32(crc);
668 con->out_msg->footer.flags = CEPH_MSG_FOOTER_COMPLETE; 670 con->out_msg->footer.flags = 0;
669 671
670 crc = crc32c(0, m->front.iov_base, m->front.iov_len); 672 crc = crc32c(0, m->front.iov_base, m->front.iov_len);
671 con->out_msg->footer.front_crc = cpu_to_le32(crc); 673 con->out_msg->footer.front_crc = cpu_to_le32(crc);