]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/osd_types: encode pg_pool_t like hammer if features indicate hammer
authorSage Weil <sage@redhat.com>
Wed, 23 Nov 2016 18:51:59 +0000 (13:51 -0500)
committerSage Weil <sage@redhat.com>
Wed, 23 Nov 2016 19:38:51 +0000 (14:38 -0500)
If the target features are missing the new OSDOp encoding, the
first feature we added post-hammer, encode like hammer.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 2f8cfb632823ba4e63eaff394392d6af7979d7c8)

src/osd/osd_types.cc

index 55eba9d972d3df2f1e43a20cdc665a15a8d168c5..171b3f1734000f5b0424c70f09c03b084ce2dd0b 100644 (file)
@@ -1494,6 +1494,12 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const
   }
 
   uint8_t v = 24;
+  if (!(features & CEPH_FEATURE_NEW_OSDOP_ENCODING)) {
+    // this was the first post-hammer thing we added; if it's missing, encode
+    // like hammer.
+    v = 21;
+  }
+
   ENCODE_START(v, 5, bl);
   ::encode(type, bl);
   ::encode(size, bl);