]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Fix fast path to use version bumped value
authorDavid Zafman <dzafman@redhat.com>
Fri, 12 Apr 2019 16:44:14 +0000 (09:44 -0700)
committerDavid Zafman <dzafman@redhat.com>
Fri, 12 Apr 2019 20:16:31 +0000 (13:16 -0700)
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 <dzafman@redhat.com>
src/osd/osd_types.cc

index cc3ec866e433bb455ca47f7b705dfd3430bc02dd..6240612a04b9b530d5185e480f7139bfe62d4deb 100644 (file)
@@ -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;
   }