]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Fix fast path to use version bumped value 27555/head
authorDavid Zafman <dzafman@redhat.com>
Fri, 12 Apr 2019 16:44:14 +0000 (09:44 -0700)
committerSage Weil <sage@redhat.com>
Mon, 15 Apr 2019 01:14:20 +0000 (20:14 -0500)
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>
(cherry picked from commit a35f1a9ce1d8c3ed1889da5a8d20b1974b1e9684)

src/osd/osd_types.cc

index af3f0d70a01c3989a0c84e6152afa3b7baba1d34..6c73ce71817ac48d8c6dfeffed643a54e8dfbf44 100644 (file)
@@ -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;
   }