Commit 4690faf0 authored by Ilya Dryomov's avatar Ilya Dryomov

libceph: don't call ->reencode_message() more than once per message

Reencoding an already reencoded message is a bad idea.  This could
happen on Policy::stateful_server connections (!CEPH_MSG_CONNECT_LOSSY),
such as MDS sessions.

This didn't pop up in testing because currently only OSD requests are
reencoded and OSD sessions are always lossy.

Fixes: 98ad5ebd ("libceph: ceph_connection_operations::reencode_message() method")
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
Reviewed-by: default avatar"Yan, Zheng" <zyan@redhat.com>
parent 986e8989
......@@ -1287,10 +1287,10 @@ static void prepare_write_message(struct ceph_connection *con)
if (m->needs_out_seq) {
m->hdr.seq = cpu_to_le64(++con->out_seq);
m->needs_out_seq = false;
}
if (con->ops->reencode_message)
con->ops->reencode_message(m);
if (con->ops->reencode_message)
con->ops->reencode_message(m);
}
dout("prepare_write_message %p seq %lld type %d len %d+%d+%zd\n",
m, con->out_seq, le16_to_cpu(m->hdr.type),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment