]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
messages: Initializing uninitialized members module messages 16817/head
authoramitkuma <amitkuma@redhat.com>
Fri, 4 Aug 2017 16:46:04 +0000 (22:16 +0530)
committeramitkuma <amitkuma@redhat.com>
Fri, 4 Aug 2017 16:46:04 +0000 (22:16 +0530)
Fixes coverity Issue:

** 2. uninit_member: Non-static class member flags is not initialized in this constructor nor in any functions that it calls.
4. uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls.
CID 717301 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
6. uninit_member: Non-static class member failed_for is not initialized in this constructor nor in any functions that it calls.

2. uninit_member: Non-static class member oldest_map is not initialized in this constructor nor in any functions that it calls.
CID 717302 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
4. uninit_member: Non-static class member newest_map is not initialized in this constructor nor in any functions that it calls.

2. uninit_member: Non-static class member client_inc is not initialized in this constructor nor in any functions that it calls.
4. uninit_member: Non-static class member osdmap_epoch is not initialized in this constructor nor in any functions that it calls.
6. uninit_member: Non-static class member flags is not initialized in this constructor nor in any functions that it calls.
8. uninit_member: Non-static class member retry_attempt is not initialized in this constructor nor in any functions that it calls.
CID 717303 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
10. uninit_member: Non-static class member features is not initialized in this constructor nor in any functions that it calls.

2. uninit_member: Non-static class member flags is not initialized in this constructor nor in any functions that it calls.
4. uninit_member: Non-static class member user_version is not initialized in this constructor nor in any functions that it calls.
6. uninit_member: Non-static class member osdmap_epoch is not initialized in this constructor nor in any functions that it calls.
CID 717304 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
8. uninit_member: Non-static class member retry_attempt is not initialized in this constructor nor in any functions that it calls.

2. uninit_member: Non-static class member op is not initialized in this constructor nor in any functions that it calls.
4. uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
CID 717305 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
6. uninit_member: Non-static class member query_epoch is not initialized in this constructor nor in any functions that it calls.

CID 717306 (#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.

Signed-off-by: Amit Kumar amitkuma@redhat.com
src/messages/MOSDFailure.h
src/messages/MOSDMap.h
src/messages/MOSDOp.h
src/messages/MOSDOpReply.h
src/messages/MOSDPGBackfill.h
src/messages/MOSDPGCreate.h

index 81a9230c53078b76234cb2077f3a7805b3e5a9ac..793b4eeb5c6c5f40f7aa5247b69dc0e78026667e 100644 (file)
@@ -33,9 +33,9 @@ class MOSDFailure : public PaxosServiceMessage {
   
   uuid_d fsid;
   entity_inst_t target_osd;
-  __u8 flags;
-  epoch_t       epoch;
-  int32_t failed_for;  // known to be failed since at least this long
+  __u8 flags = 0;
+  epoch_t       epoch = 0;
+  int32_t failed_for = 0;  // known to be failed since at least this long
 
   MOSDFailure() : PaxosServiceMessage(MSG_OSD_FAILURE, 0, HEAD_VERSION) { }
   MOSDFailure(const uuid_d &fs, const entity_inst_t& f, int duration, epoch_t e)
index 0ae30f3d0fd5f0203ff4642b7c6025dd8c78fe76..72246288a51493ca59db1636abd13f9fad3316aa 100644 (file)
@@ -28,7 +28,7 @@ class MOSDMap : public Message {
   uuid_d fsid;
   map<epoch_t, bufferlist> maps;
   map<epoch_t, bufferlist> incremental_maps;
-  epoch_t oldest_map, newest_map;
+  epoch_t oldest_map =0, newest_map = 0;
 
   epoch_t get_first() const {
     epoch_t e = 0;
index 69d12a7a9df4cf4845c54270adb588157e820acf..80c6ecf77687411867dc6d71d32e00ae3fcaa691 100755 (executable)
@@ -37,11 +37,11 @@ class MOSDOp : public MOSDFastDispatchOp {
   static const int COMPAT_VERSION = 3;
 
 private:
-  uint32_t client_inc;
-  __u32 osdmap_epoch;
-  __u32 flags;
+  uint32_t client_inc = 0;
+  __u32 osdmap_epoch = 0;
+  __u32 flags = 0;
   utime_t mtime;
-  int32_t retry_attempt;   // 0 is first attempt.  -1 if we don't know.
+  int32_t retry_attempt = -1;   // 0 is first attempt.  -1 if we don't know.
 
   hobject_t hobj;
   spg_t pgid;
index 30358fdd630f40dcad284a07591e1c9c71f1e20e..19502a5602b25f6a7d5345fb01588138181b679f 100644 (file)
@@ -38,13 +38,13 @@ class MOSDOpReply : public Message {
   object_t oid;
   pg_t pgid;
   vector<OSDOp> ops;
-  int64_t flags;
+  int64_t flags = 0;
   errorcode32_t result;
   eversion_t bad_replay_version;
   eversion_t replay_version;
-  version_t user_version;
-  epoch_t osdmap_epoch;
-  int32_t retry_attempt;
+  version_t user_version = 0;
+  epoch_t osdmap_epoch = 0;
+  int32_t retry_attempt = -1;
   bool do_redirect;
   request_redirect_t redirect;
 
index 7f637b9ef83d241e238045785bbcd345d3429419..9146dd4040b3421025973eed8470106ceca521cd 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;
   spg_t pgid;
   hobject_t last_backfill;
   pg_stat_t stats;
index 01072c267fd8ed2a625351e6e0db1366933d870b..97e5e3652344d21c2914542b297f3d5347b457e6 100644 (file)
@@ -28,7 +28,7 @@ struct MOSDPGCreate : public Message {
   const static int HEAD_VERSION = 3;
   const static int COMPAT_VERSION = 3;
 
-  version_t          epoch;
+  version_t          epoch = 0;
   map<pg_t,pg_create_t> mkpg;
   map<pg_t,utime_t> ctimes;