]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
messages: Initializing member variables of module messages 16819/head
authoramitkuma <amitkuma@redhat.com>
Fri, 4 Aug 2017 17:11:18 +0000 (22:41 +0530)
committeramitkuma <amitkuma@redhat.com>
Sat, 5 Aug 2017 18:08:03 +0000 (23:38 +0530)
Fixes coverity Issue:

CID 717307 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls.
2. uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls.
CID 717308 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
4. uninit_member: Non-static class member query_epoch is not initialized in this constructor nor in any functions that it calls.
CID 717310 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls.
CID 717311 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls.
CID 717312 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member op is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
CID 717313 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member query_epoch is not initialized in this constructor nor in any functions that it calls.
CID 717314 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
CID 717315 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
CID 717316 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member op is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
CID 717317 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member min_epoch is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member repair is not initialized in this constructor nor in any functions that it calls.
CID 717318 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
4. uninit_member: Non-static class member deep is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member acks_wanted is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member old_exists is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member old_size is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member first is not initialized in this constructor nor in any functions that it calls.
CID 717319 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member complete is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member ack_type is not initialized in this constructor nor in any functions that it calls.
CID 717320 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member result is not initialized in this constructor nor in any functions that it calls.
CID 717321 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls
uninit_member: Non-static class member pool is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member op is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member auid is not initialized in this constructor nor in any functions that it calls.
CID 717322 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member crush_rule is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member replyCode is not initialized in this constructor nor in any functions that it calls.
CID 717323 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Amit Kumar amitkuma@redhat.com
16 files changed:
src/messages/MOSDPGInfo.h
src/messages/MOSDPGLog.h
src/messages/MOSDPGNotify.h
src/messages/MOSDPGQuery.h
src/messages/MOSDPGRemove.h
src/messages/MOSDPGScan.h
src/messages/MOSDPGTemp.h
src/messages/MOSDPGTrim.h
src/messages/MOSDPing.h
src/messages/MOSDRepScrub.h
src/messages/MOSDScrub.h
src/messages/MOSDSubOp.h
src/messages/MOSDSubOpReply.h
src/messages/MPGStats.h
src/messages/MPoolOp.h
src/messages/MPoolOpReply.h

index 106c499cdde66447a2bc480fadd2a32fac7a8585..e17dcf7cc8d004a1204dce3b5d20f356a4e14468 100644 (file)
@@ -23,7 +23,7 @@ class MOSDPGInfo : public Message {
   static const int HEAD_VERSION = 5;
   static const int COMPAT_VERSION = 1;
 
-  epoch_t epoch;
+  epoch_t epoch = 0;
 
 public:
   vector<pair<pg_notify_t,PastIntervals> > pg_list;
index 57c8a0efe7e7e666ead11c1d1d6c64791bc3b203..ac6a1f72bd53c502eff945d21a34448fbc9fea84 100644 (file)
@@ -23,12 +23,12 @@ class MOSDPGLog : public Message {
   static const int HEAD_VERSION = 5;
   static const int COMPAT_VERSION = 2;
 
-  epoch_t epoch;
+  epoch_t epoch = 0;
   /// query_epoch is the epoch of the query being responded to, or
   /// the current epoch if this is not being sent in response to a
   /// query. This allows the recipient to disregard responses to old
   /// queries.
-  epoch_t query_epoch;
+  epoch_t query_epoch = 0;
 
 public:
   shard_id_t to;
index a93dfce187403bde568d2ffcc8ad1dca5f986208..a73bf05692a4dad1e5aa11e0fa02b4746ddd979b 100644 (file)
@@ -28,7 +28,7 @@ class MOSDPGNotify : public Message {
   static const int HEAD_VERSION = 6;
   static const int COMPAT_VERSION = 2;
 
-  epoch_t epoch;
+  epoch_t epoch = 0;
   /// query_epoch is the epoch of the query being responded to, or
   /// the current epoch if this is not being sent in response to a
   /// query. This allows the recipient to disregard responses to old
index bd6bf44150be2c2aaeb5fc4ebc114d3d0ae5a14c..9c4595687b4bb6fb0b5d50a170081db12323754f 100644 (file)
@@ -27,7 +27,7 @@ class MOSDPGQuery : public Message {
   static const int HEAD_VERSION = 4;
   static const int COMPAT_VERSION = 3;
 
-  version_t epoch;
+  version_t epoch = 0;
 
  public:
   version_t get_epoch() const { return epoch; }
index 0a6afa507218d8bf21e3b426335e8d460aacbeec..f692ad428c361edb0d01456a38049855eacdbc0c 100644 (file)
@@ -25,7 +25,7 @@ class MOSDPGRemove : public Message {
   static const int HEAD_VERSION = 3;
   static const int COMPAT_VERSION = 2;
 
-  epoch_t epoch;
+  epoch_t epoch = 0;
 
  public:
   vector<spg_t> pg_list;
index 3c01b406fd850f6175b13f93b6d432529095b924..16fa3c52294f0e31113898cdd3b01d86db17d9b9 100644 (file)
@@ -35,8 +35,8 @@ public:
     }
   }
 
-  __u32 op;
-  epoch_t map_epoch, query_epoch;
+  __u32 op = 0;
+  epoch_t map_epoch = 0, query_epoch = 0;
   pg_shard_t from;
   spg_t pgid;
   hobject_t begin, end;
index 5366fed183502c625028a1c81cd1d36261eadfd7..3ea7a211c7f4b971d00e5e246a779b94e17778e1 100644 (file)
@@ -21,7 +21,7 @@
 
 class MOSDPGTemp : public PaxosServiceMessage {
  public:
-  epoch_t map_epoch;
+  epoch_t map_epoch = 0;
   map<pg_t, vector<int32_t> > pg_temp;
 
   MOSDPGTemp(epoch_t e) : PaxosServiceMessage(MSG_OSD_PGTEMP, e), map_epoch(e) { }
index 030da7c2c8dc702c4234d1f2000a2fdab22bdd35..35168e0f484667c98f3fe6ad8b71c9bd0f7dc093 100644 (file)
@@ -23,7 +23,7 @@ class MOSDPGTrim : public Message {
   static const int COMPAT_VERSION = 2;
 
 public:
-  epoch_t epoch;
+  epoch_t epoch = 0;
   spg_t pgid;
   eversion_t trim_to;
 
index c286319ebf81ecad8f803453f48b7ff1619c7127..90ea498a7bc331834a9b0bca4b22d6488b24be0a 100644 (file)
@@ -59,8 +59,8 @@ class MOSDPing : public Message {
   }
 
   uuid_d fsid;
-  epoch_t map_epoch;
-  __u8 op;
+  epoch_t map_epoch = 0;
+  __u8 op = 0;
   utime_t stamp;
   uint32_t min_message_size;
 
index 8b2304278546543778b6510e3bc1cdcd4760a33c..ce800aac068b3543fb981a595d0b27578912affd 100644 (file)
@@ -30,7 +30,7 @@ struct MOSDRepScrub : public MOSDFastDispatchOp {
   spg_t pgid;             // PG to scrub
   eversion_t scrub_from; // only scrub log entries after scrub_from
   eversion_t scrub_to;   // last_update_applied when message sent
-  epoch_t map_epoch, min_epoch;
+  epoch_t map_epoch = 0, min_epoch = 0;
   bool chunky;           // true for chunky scrubs
   hobject_t start;       // lower bound of scrub, inclusive
   hobject_t end;         // upper bound of scrub, exclusive
index af8281e7c46fa6b05cbf8b7823fcdaff6e2c4ed9..d9659fa7fb9b0ff19b76bd682013df7a026d4fd1 100644 (file)
@@ -29,8 +29,8 @@ struct MOSDScrub : public Message {
 
   uuid_d fsid;
   vector<pg_t> scrub_pgs;
-  bool repair;
-  bool deep;
+  bool repair = false;
+  bool deep = false;
 
   MOSDScrub() : Message(MSG_OSD_SCRUB, HEAD_VERSION, COMPAT_VERSION) {}
   MOSDScrub(const uuid_d& f, bool r, bool d) :
index 3bab8f57770a7ad4fcae204eea71960675b6f1b9..4fd3a522fd32132f6ccffcf76861d3cfddc4acaf 100644 (file)
@@ -30,7 +30,7 @@ class MOSDSubOp : public MOSDFastDispatchOp {
   static const int COMPAT_VERSION = 7;
 
 public:
-  epoch_t map_epoch;
+  epoch_t map_epoch = 0;
   
   // metadata from original request
   osd_reqid_t reqid;
@@ -41,14 +41,14 @@ public:
   hobject_t poid;
   object_locator_t oloc;
   
-  __u8 acks_wanted;
+  __u8 acks_wanted = 0;
 
   // op to exec
   vector<OSDOp> ops;
   utime_t mtime;
 
-  bool old_exists;
-  uint64_t old_size;
+  bool old_exists = false;
+  uint64_t old_size = 0;
   eversion_t old_version;
 
   SnapSet snapset;
@@ -71,7 +71,7 @@ public:
   interval_set<uint64_t> data_subset;
   map<hobject_t, interval_set<uint64_t>> clone_subsets;
 
-  bool first, complete;
+  bool first = false, complete = false;
 
   interval_set<uint64_t> data_included;
   ObjectRecoveryInfo recovery_info;
index 691d4e2c1102b5ce28e68e0e31bc9af65a2694ff..332d38aa18d8135aef90d3034ecbdea1d46d7482 100644 (file)
@@ -33,7 +33,7 @@ class MOSDSubOpReply : public MOSDFastDispatchOp {
   static const int HEAD_VERSION = 2;
   static const int COMPAT_VERSION = 1;
 public:
-  epoch_t map_epoch;
+  epoch_t map_epoch = 0;
   
   // subop metadata
   osd_reqid_t reqid;
@@ -44,8 +44,8 @@ public:
   vector<OSDOp> ops;
 
   // result
-  __u8 ack_type;
-  int32_t result;
+  __u8 ack_type = 0;
+  int32_t result = 0;
   
   // piggybacked osd state
   eversion_t last_complete_ondisk;
index dcceff2b3c2083f9b67f0bcac1886899d28d621b..c368675a89d49c9c7f39882ccb4c19231a92196d 100644 (file)
@@ -23,7 +23,7 @@ public:
   uuid_d fsid;
   map<pg_t,pg_stat_t> pg_stat;
   osd_stat_t osd_stat;
-  epoch_t epoch;
+  epoch_t epoch = 0;
   utime_t had_map_for;
   
   MPGStats() : PaxosServiceMessage(MSG_PGSTATS, 0) {}
index e694bbe7c90ec2facf82c0f7e4df85ad777c9cb8..15d97faa2c4bfdd53f0a7724941a94a7b80b3126 100644 (file)
@@ -25,12 +25,12 @@ class MPoolOp : public PaxosServiceMessage {
 
 public:
   uuid_d fsid;
-  __u32 pool;
+  __u32 pool = 0;
   string name;
-  __u32 op;
-  uint64_t auid;
+  __u32 op = 0;
+  uint64_t auid = 0;
   snapid_t snapid;
-  __s16 crush_rule;
+  __s16 crush_rule = 0;
 
   MPoolOp()
     : PaxosServiceMessage(CEPH_MSG_POOLOP, 0, HEAD_VERSION, COMPAT_VERSION) { }
index abc489b5e111fbbedc688c1f3f11eee56b659339..0374c1d904a1c21e27d565470e343d8f91eb5cdd 100644 (file)
@@ -20,8 +20,8 @@
 class MPoolOpReply : public PaxosServiceMessage {
 public:
   uuid_d fsid;
-  __u32 replyCode;
-  epoch_t epoch;
+  __u32 replyCode = 0;
+  epoch_t epoch = 0;
   bufferlist response_data;
 
   MPoolOpReply() : PaxosServiceMessage(CEPH_MSG_POOLOP_REPLY, 0)