]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
messages/MOSDMarkMeDown: fix uninit field
authorSage Weil <sage@inktank.com>
Wed, 22 May 2013 21:29:37 +0000 (14:29 -0700)
committerSage Weil <sage@inktank.com>
Wed, 19 Jun 2013 19:39:36 +0000 (12:39 -0700)
Fixes valgrind warning:
==14803== Use of uninitialised value of size 8
==14803==    at 0x12E7614: sctp_crc32c_sb8_64_bit (sctp_crc32.c:567)
==14803==    by 0x12E76F8: update_crc32 (sctp_crc32.c:609)
==14803==    by 0x12E7720: ceph_crc32c_le (sctp_crc32.c:733)
==14803==    by 0x105085F: ceph::buffer::list::crc32c(unsigned int) (buffer.h:427)
==14803==    by 0x115D7B2: Message::calc_front_crc() (Message.h:441)
==14803==    by 0x1159BB0: Message::encode(unsigned long, bool) (Message.cc:170)
==14803==    by 0x1323934: Pipe::writer() (Pipe.cc:1524)
==14803==    by 0x13293D9: Pipe::Writer::entry() (Pipe.h:59)
==14803==    by 0x120A398: Thread::_entry_func(void*) (Thread.cc:41)
==14803==    by 0x503BE99: start_thread (pthread_create.c:308)
==14803==    by 0x6C6E4BC: clone (clone.S:112)

Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit eb91f41042fa31df2bef9140affa6eac726f6187)

src/messages/MOSDMarkMeDown.h

index e99c83d18dd7178b3d335372940644b7a38ff762..1a0475dc5216dea2f576e7607fed42f7a0296f0d 100644 (file)
@@ -24,7 +24,7 @@ class MOSDMarkMeDown : public PaxosServiceMessage {
  public:
   uuid_d fsid;
   entity_inst_t target_osd;
-  epoch_t e;
+  epoch_t epoch;
   bool ack;
 
   MOSDMarkMeDown()
@@ -32,27 +32,27 @@ class MOSDMarkMeDown : public PaxosServiceMessage {
   MOSDMarkMeDown(const uuid_d &fs, const entity_inst_t& f,
                 epoch_t e, bool ack)
     : PaxosServiceMessage(MSG_OSD_MARK_ME_DOWN, e, HEAD_VERSION),
-      fsid(fs), target_osd(f), ack(ack) {}
+      fsid(fs), target_osd(f), epoch(e), ack(ack) {}
  private:
   ~MOSDMarkMeDown() {}
 
 public: 
   entity_inst_t get_target() { return target_osd; }
-  epoch_t get_epoch() { return e; }
+  epoch_t get_epoch() { return epoch; }
 
   void decode_payload() {
     bufferlist::iterator p = payload.begin();
     paxos_decode(p);
     ::decode(fsid, p);
     ::decode(target_osd, p);
-    ::decode(e, p);
+    ::decode(epoch, p);
     ::decode(ack, p);
   }
   void encode_payload(uint64_t features) {
     paxos_encode();
     ::encode(fsid, payload);
     ::encode(target_osd, payload);
-    ::encode(e, payload);
+    ::encode(epoch, payload);
     ::encode(ack, payload);
   }