From a35f1a9ce1d8c3ed1889da5a8d20b1974b1e9684 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 --- 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 cc3ec866e43..6240612a04b 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -2323,9 +2323,10 @@ void object_stat_sum_t::encode(ceph::buffer::list& bl) const void object_stat_sum_t::decode(ceph::buffer::list::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.39.5