]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: Move bufferlist before use 18258/head
authorShinobu Kinjo <shinobu@redhat.com>
Thu, 12 Oct 2017 02:03:12 +0000 (11:03 +0900)
committerShinobu Kinjo <shinobu@redhat.com>
Thu, 12 Oct 2017 02:03:12 +0000 (11:03 +0900)
Signed-off-by: Shinobu Kinjo <shinobu@redhat.com>
src/mon/OSDMonitor.cc

index 43e8861864f9287a7ec5cfe32370b10ddef0c0b0..5c8f00ee1b235099fcdb43ed41a5ade249842480 100644 (file)
@@ -922,8 +922,6 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t)
     }
   }
 
-  bufferlist bl;
-
   {
     OSDMap tmp;
     tmp.deepish_copy_from(osdmap);
@@ -1197,6 +1195,7 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t)
 
   // encode
   assert(get_last_committed() + 1 == pending_inc.epoch);
+  bufferlist bl;
   ::encode(pending_inc, bl, features | CEPH_FEATURE_RESERVED);
 
   dout(20) << " full_crc " << tmp.get_crc()