libceph: don't call encode_request_finish() on MOSDBackoff messages
authorIlya Dryomov <idryomov@gmail.com>
Fri, 14 Jul 2017 14:08:54 +0000 (16:08 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 17 Jul 2017 12:54:59 +0000 (14:54 +0200)
encode_request_finish() is for MOSDOp messages.  Calling it on
MOSDBackoff ack-block messages corrupts them.

Fixes: a02a946dfe96 ("libceph: respect RADOS_BACKOFF backoffs")
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
net/ceph/osd_client.c

index 86a9737d8e3ff7f86c0ea12e9d417e084b725816..901bb8221366253efb0baa139aee4fa62e8e71e0 100644 (file)
@@ -5310,7 +5310,10 @@ static int invalidate_authorizer(struct ceph_connection *con)
 
 static void osd_reencode_message(struct ceph_msg *msg)
 {
-       encode_request_finish(msg);
+       int type = le16_to_cpu(msg->hdr.type);
+
+       if (type == CEPH_MSG_OSD_OP)
+               encode_request_finish(msg);
 }
 
 static int osd_sign_message(struct ceph_msg *msg)