From: Ilya Dryomov Date: Thu, 15 Mar 2018 14:26:21 +0000 (+0100) Subject: osd/OSDMap: fix HAVE_FEATURE logic in encode() X-Git-Tag: v13.1.0~549^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e28e0c617af8825ae92cced5d87cc4f403709e48;p=ceph.git osd/OSDMap: fix HAVE_FEATURE logic in encode() Currently clients that don't have SERVER_LUMINOUS end up being fed v6 (i.e. luminous) encoding because they also don't have SERVER_MIMIC. This was introduced in commit 553048fbf97a ("osd/OSDMap: track newly removed and purged snaps in each epoch"). Signed-off-by: Ilya Dryomov --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 8a7a657e27adc..8ba0bb40e5805 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -486,8 +486,7 @@ void OSDMap::Incremental::encode(bufferlist& bl, uint64_t features) const uint8_t v = 6; if (!HAVE_FEATURE(features, SERVER_LUMINOUS)) { v = 3; - } - if (!HAVE_FEATURE(features, SERVER_MIMIC)) { + } else if (!HAVE_FEATURE(features, SERVER_MIMIC)) { v = 5; } ENCODE_START(v, 1, bl); // client-usable data @@ -2523,8 +2522,7 @@ void OSDMap::encode(bufferlist& bl, uint64_t features) const uint8_t v = 7; if (!HAVE_FEATURE(features, SERVER_LUMINOUS)) { v = 3; - } - if (!HAVE_FEATURE(features, SERVER_MIMIC)) { + } else if (!HAVE_FEATURE(features, SERVER_MIMIC)) { v = 6; } ENCODE_START(v, 1, bl); // client-usable data @@ -2600,8 +2598,7 @@ void OSDMap::encode(bufferlist& bl, uint64_t features) const uint8_t target_v = 6; if (!HAVE_FEATURE(features, SERVER_LUMINOUS)) { target_v = 1; - } - if (!HAVE_FEATURE(features, SERVER_MIMIC)) { + } else if (!HAVE_FEATURE(features, SERVER_MIMIC)) { target_v = 5; } ENCODE_START(target_v, 1, bl); // extended, osd-only data