]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Initializing start_offset,last_offset,offset 19333/head
authoramitkuma <amitkuma@redhat.com>
Tue, 5 Dec 2017 15:31:52 +0000 (21:01 +0530)
committeramitkuma <amitkuma@redhat.com>
Tue, 5 Dec 2017 15:31:52 +0000 (21:01 +0530)
Fixes the coverity issues:

2. uninit_member: Non-static class member start_offset
is not initialized in this constructor nor in any functions
that it calls.

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

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

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h

index 2fb52543e1e9749f4c61bce5244f78cbe9848760..7575731a96abaa4afd339de1d6e9304b7a38aa0b 100644 (file)
@@ -8032,7 +8032,7 @@ struct C_CopyChunk : public Context {
   epoch_t last_peering_reset;
   ceph_tid_t tid;
   PrimaryLogPG::CopyOpRef cop;
-  uint64_t offset;
+  uint64_t offset = 0;
   C_CopyChunk(PrimaryLogPG *p, hobject_t o, epoch_t lpr,
             const PrimaryLogPG::CopyOpRef& c)
     : pg(p), oid(o), last_peering_reset(lpr),
index 5ef905898de79ddff4f2e9825de7e7facea9abf3..936cd0393f1c4cbbbc0a1d70b9d31510fa9d303f 100644 (file)
@@ -155,8 +155,8 @@ public:
     map<uint64_t, CopyOpRef> chunk_cops;
     int num_chunk;
     bool failed;
-    uint64_t start_offset;
-    uint64_t last_offset;
+    uint64_t start_offset = 0;
+    uint64_t last_offset = 0;
     vector<OSDOp> chunk_ops;
   
     CopyOp(CopyCallback *cb_, ObjectContextRef _obc, hobject_t s,