summaryrefslogtreecommitdiffstats
path: root/fs/ceph/messenger.c
diff options
context:
space:
mode:
authorSage Weil2010-03-02 00:25:00 +0100
committerSage Weil2010-03-02 00:25:00 +0100
commit3ca02ef96e119d36bc1752baeae7dd0c59c2f325 (patch)
tree5ef2a149d0f67b3f59fd5c4b168712046f7ce7f2 /fs/ceph/messenger.c
parentceph: fix snaptrace decoding on cap migration between mds (diff)
downloadkernel-qcow2-linux-3ca02ef96e119d36bc1752baeae7dd0c59c2f325.tar.gz
kernel-qcow2-linux-3ca02ef96e119d36bc1752baeae7dd0c59c2f325.tar.xz
kernel-qcow2-linux-3ca02ef96e119d36bc1752baeae7dd0c59c2f325.zip
ceph: reset front len on return to msgpool; BUG on mismatched front iov
Reset msg front len when a message is returned to the pool: the caller may have changed it. BUG if we try to send a message with a hdr.front_len that doesn't match the front iov. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/messenger.c')
-rw-r--r--fs/ceph/messenger.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ceph/messenger.c b/fs/ceph/messenger.c
index bf4590c77cf6..781656a49bf8 100644
--- a/fs/ceph/messenger.c
+++ b/fs/ceph/messenger.c
@@ -1954,6 +1954,8 @@ void ceph_con_send(struct ceph_connection *con, struct ceph_msg *msg)
msg->hdr.src.addr = con->msgr->my_enc_addr;
msg->hdr.orig_src = msg->hdr.src;
+ BUG_ON(msg->front.iov_len != le32_to_cpu(msg->hdr.front_len));
+
/* queue */
mutex_lock(&con->mutex);
BUG_ON(!list_empty(&msg->list_head));