aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2017-07-26 03:59:15 -0400
committerIlya Dryomov <idryomov@gmail.com>2017-08-01 10:46:43 -0400
commit4690faf00cf838392ce038202a85ac0d5f1df598 (patch)
tree97424e686197e1bc440723548a312248aee27e9d
parent986e89898acb3d8f750f259a90cb73afca426b58 (diff)
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: 98ad5ebd1505 ("libceph: ceph_connection_operations::reencode_message() method") Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
-rw-r--r--net/ceph/messenger.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index b7cc615d42ef..a67298c7e0cd 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -1287,10 +1287,10 @@ static void prepare_write_message(struct ceph_connection *con)
1287 if (m->needs_out_seq) { 1287 if (m->needs_out_seq) {
1288 m->hdr.seq = cpu_to_le64(++con->out_seq); 1288 m->hdr.seq = cpu_to_le64(++con->out_seq);
1289 m->needs_out_seq = false; 1289 m->needs_out_seq = false;
1290 }
1291 1290
1292 if (con->ops->reencode_message) 1291 if (con->ops->reencode_message)
1293 con->ops->reencode_message(m); 1292 con->ops->reencode_message(m);
1293 }
1294 1294
1295 dout("prepare_write_message %p seq %lld type %d len %d+%d+%zd\n", 1295 dout("prepare_write_message %p seq %lld type %d len %d+%d+%zd\n",
1296 m, con->out_seq, le16_to_cpu(m->hdr.type), 1296 m, con->out_seq, le16_to_cpu(m->hdr.type),