]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/Beacon.*: fix UNINIT_CTOR cases
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 17 Sep 2014 17:31:13 +0000 (19:31 +0200)
committerSage Weil <sage@redhat.com>
Fri, 19 Sep 2014 18:35:02 +0000 (11:35 -0700)
CID 1238905 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 uninit_member: Non-static class member want_state is not initialized
  in this constructor nor in any functions that it calls.
 uninit_member: Non-static class member last_send is not initialized
  in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit ff6148324ad0957f74e8b4b49c1a1e8df9fb94e4)

src/mds/Beacon.cc
src/mds/Beacon.h

index f5832ac4eb70badce45fb08f38f03835a2f9f6a2..6f7d1288dcb27a6655984792dffeeb0e1fa41f67 100644 (file)
@@ -19,8 +19,9 @@
 
 #include "messages/MMDSBeacon.h"
 #include "mon/MonClient.h"
-#include "mds/MDS.h"
 #include "mds/MDLog.h"
+#include "mds/MDS.h"
+#include "mds/MDSMap.h"
 #include "mds/Locker.h"
 
 #include "Beacon.h"
@@ -33,6 +34,8 @@
 Beacon::Beacon(CephContext *cct_, MonClient *monc_, std::string name_) :
   Dispatcher(cct_), lock("Beacon"), monc(monc_), timer(g_ceph_context, lock), name(name_)
 {
+  want_state = MDSMap::STATE_NULL;
+  last_send = 0;
   last_seq = 0;
   sender = NULL;
   was_laggy = false;
index 883044494839c91decce419f52e02db31f24644c..9148366d94f5a3ee0d06d2033e6345de8cc8ceae 100644 (file)
@@ -54,9 +54,9 @@ class Beacon : public Dispatcher
 
   // Internal beacon state
   version_t last_send;
-  version_t               last_seq;          // last seq sent to monitor
+  version_t last_seq;          // last seq sent to monitor
   std::map<version_t,utime_t>  seq_stamp;    // seq # -> time sent
-  utime_t                 last_acked_stamp;  // last time we sent a beacon that got acked
+  utime_t last_acked_stamp;  // last time we sent a beacon that got acked
   utime_t last_mon_reconnect;
   bool was_laggy;
   utime_t laggy_until;