]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
messages/MOSDOp: clear reqid inc for v6 encoding 8299/head
authorSage Weil <sage@redhat.com>
Sat, 26 Mar 2016 01:56:01 +0000 (21:56 -0400)
committerSage Weil <sage@redhat.com>
Sat, 26 Mar 2016 01:56:10 +0000 (21:56 -0400)
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 <sage@redhat.com>
src/messages/MOSDOp.h

index fc087fca54721fbccaa8c80b4af286a32844148a..3384c964db886de12793d2aab56c1402327ac12b 100755 (executable)
@@ -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;