]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMap: fill in known encode_features where possible 6132/head
authorSamuel Just <sjust@redhat.com>
Fri, 25 Sep 2015 01:35:39 +0000 (18:35 -0700)
committerNathan Cutler <ncutler@suse.com>
Wed, 30 Sep 2015 21:05:44 +0000 (23:05 +0200)
Otherwise, if we get an incremental from hammer (struct_v = 6) we will
encode the full map as if it were before CEPH_FEATURE_PGID64, which
was actually pre-argonaut.  Similarly, if struct_v >= 7, we know it
was encoded with CEPH_FEATURE_OSDMAP_ENC.

Fixes: #13234
Backport: hammer
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 04679c5451e353c966f6ed00b33fa97be8072a79)

src/osd/OSDMap.cc

index a9154d48a297a85402e5f0b651111e2fd99f4b86..173b468b5b0ed1118bae3b28043d78029b5f5e5b 100644 (file)
@@ -590,6 +590,10 @@ void OSDMap::Incremental::decode(bufferlist::iterator& bl)
     bl.advance(-struct_v_size);
     decode_classic(bl);
     encode_features = 0;
+    if (struct_v >= 6)
+      encode_features = CEPH_FEATURE_PGID64;
+    else
+      encode_features = 0;
     return;
   }
   {
@@ -641,7 +645,7 @@ void OSDMap::Incremental::decode(bufferlist::iterator& bl)
     if (struct_v >= 2)
       ::decode(encode_features, bl);
     else
-      encode_features = 0;
+      encode_features = CEPH_FEATURE_PGID64 | CEPH_FEATURE_OSDMAP_ENC;
     DECODE_FINISH(bl); // osd-only data
   }