]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: warn if reencoding and OSDMap with fewer features than the mon
authorSage Weil <sage@redhat.com>
Sat, 16 Aug 2014 00:36:14 +0000 (17:36 -0700)
committerSage Weil <sage@redhat.com>
Mon, 10 Nov 2014 22:20:24 +0000 (14:20 -0800)
It is very dangerous to reencode and OSDMap with fewer features than the
mon intended as we may be introducing a different variation of the same
OSDMap epoch into the wild.  Add a build warning here as well as this is
a potentially serious problem.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc

index 322cf5c0f6b2d2fcc6e667d27f70a791a2bd2905..ade5b99468c970d6713d165df0f778b0364cf7fb 100644 (file)
@@ -6191,6 +6191,11 @@ void OSD::handle_osd_map(MOSDMap *m)
       if (o->test_flag(CEPH_OSDMAP_FULL))
        last_marked_full = e;
 
+#warning FIXME: we are unsafely encoding a new full OSDMap
+      if (inc.encode_features & ~CEPH_FEATURES_ALL)
+       derr << "WARNING: encoding full OSDMap with fewer features than the mon"
+            << dendl;
+
       bufferlist fbl;
       o->encode(fbl);