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>
diff --git a/fs/ceph/messenger.c b/fs/ceph/messenger.c
index bf4590c..781656a 100644
--- a/fs/ceph/messenger.c
+++ b/fs/ceph/messenger.c
@@ -1954,6 +1954,8 @@
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));