From f326d20a80c43aeb40e9c9a95ce23207b405c9de Mon Sep 17 00:00:00 2001 From: David Zafman Date: Fri, 12 Apr 2019 09:44:14 -0700 Subject: [PATCH] osd: Fix fast path to use version bumped value Fix the code so that the version is in one place for both the slow and fast path. Caused by: d2ca3d2feb442f97ca89023c7d01178d96f517a6 Fixes: http://tracker.ceph.com/issues/39281 Signed-off-by: David Zafman (cherry picked from commit a35f1a9ce1d8c3ed1889da5a8d20b1974b1e9684) --- src/osd/osd_types.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index af3f0d70a01c..6c73ce71817a 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -2293,9 +2293,10 @@ void object_stat_sum_t::encode(bufferlist& bl) const void object_stat_sum_t::decode(bufferlist::const_iterator& bl) { bool decode_finish = false; - DECODE_START(20, bl); // make sure to also update fast decode below + static const int STAT_SUM_DECODE_VERSION = 20; + DECODE_START(STAT_SUM_DECODE_VERSION, bl); #if defined(CEPH_LITTLE_ENDIAN) - if (struct_v >= 19) { // this must match newest decode version + if (struct_v == STAT_SUM_DECODE_VERSION) { bl.copy(sizeof(object_stat_sum_t), (char*)(&num_bytes)); decode_finish = true; } -- 2.47.3