From: Danny Al-Gaaf Date: Wed, 17 Sep 2014 17:31:13 +0000 (+0200) Subject: mds/Beacon.*: fix UNINIT_CTOR cases X-Git-Tag: v0.86~46 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1f134bb06fd7141dd51e33db722ae6f664c19e78;p=ceph.git mds/Beacon.*: fix UNINIT_CTOR cases 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 (cherry picked from commit ff6148324ad0957f74e8b4b49c1a1e8df9fb94e4) --- diff --git a/src/mds/Beacon.cc b/src/mds/Beacon.cc index f5832ac4eb70..6f7d1288dcb2 100644 --- a/src/mds/Beacon.cc +++ b/src/mds/Beacon.cc @@ -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; diff --git a/src/mds/Beacon.h b/src/mds/Beacon.h index 883044494839..9148366d94f5 100644 --- a/src/mds/Beacon.h +++ b/src/mds/Beacon.h @@ -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 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;