From bdca28ddfb4a1172e58f40d38df250d17f014baf Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 25 Mar 2016 21:56:01 -0400 Subject: [PATCH] messages/MOSDOp: clear reqid inc for v6 encoding For the new v7 encoding, we put the client incarnation in the reqid so that we can have it at the beginning of the encoding. However, we do *not* want to do this for the v6 encoding, as that version of get_reqid() will return reqid if it is not == osd_reqid_t(). Fixes: #15230 Signed-off-by: Sage Weil --- src/messages/MOSDOp.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/messages/MOSDOp.h b/src/messages/MOSDOp.h index fc087fca54721..3384c964db886 100755 --- a/src/messages/MOSDOp.h +++ b/src/messages/MOSDOp.h @@ -315,7 +315,13 @@ struct ceph_osd_request_head { ::encode(retry_attempt, payload); ::encode(features, payload); - ::encode(reqid, payload); + if (reqid.name != entity_name_t() || reqid.tid != 0) { + ::encode(reqid, payload); + } else { + // don't include client_inc in the reqid for the legacy v6 + // encoding or else we'll confuse older peers. + ::encode(osd_reqid_t(), payload); + } } else { // new, reordered, v7 message encoding header.version = HEAD_VERSION; -- 2.39.5