From: Sage Weil Date: Fri, 7 Apr 2017 19:40:21 +0000 (-0400) Subject: msg/Message: make {encode,decode}_trace unconditional X-Git-Tag: v12.0.3~73^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=25eb14247d86012557a260264c5d4c7bfb590abb;p=ceph.git msg/Message: make {encode,decode}_trace unconditional These are protocol features and cannot vary based on our compilation. Encode and decode unconditionally. The callers have already guarded these field additions with a message version bump and are conditionally calling decode_trace. Signed-off-by: Sage Weil --- diff --git a/src/msg/Message.cc b/src/msg/Message.cc index 4edbff051b8..62cbcdd33cb 100644 --- a/src/msg/Message.cc +++ b/src/msg/Message.cc @@ -846,26 +846,25 @@ WRITE_RAW_ENCODER(blkin_trace_info) void Message::encode_trace(bufferlist &bl, uint64_t features) const { -#ifdef WITH_BLKIN - if (features & CEPH_FEATURE_BLKIN_TRACING) - ::encode(*trace.get_info(), bl); -#endif + auto p = trace.get_info(); + static const blkin_trace_info empty = { 0, 0, 0 }; + if (!p) { + p = ∅ + } + ::encode(*p, bl); } void Message::decode_trace(bufferlist::iterator &p, bool create) { + blkin_trace_info info = {}; + ::decode(info, p); + #ifdef WITH_BLKIN if (!connection) return; const auto msgr = connection->get_messenger(); const auto endpoint = msgr->get_trace_endpoint(); - blkin_trace_info info = {}; - - // only decode a trace if both sides of the connection agree - if (connection->has_feature(CEPH_FEATURE_BLKIN_TRACING)) - ::decode(info, p); - if (info.trace_id) { trace.init(get_type_name(), endpoint, &info, true); trace.event("decoded trace");