From: Sage Weil Date: Sat, 16 Aug 2014 00:36:14 +0000 (-0700) Subject: osd: warn if reencoding and OSDMap with fewer features than the mon X-Git-Tag: v0.91~55^2~2^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=110c093cf3fe30da5fc8ec5aef64615851f8ce67;p=ceph.git osd: warn if reencoding and OSDMap with fewer features than the mon 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 --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 322cf5c0f6b..ade5b99468c 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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);