From: amitkuma Date: Tue, 5 Dec 2017 15:31:52 +0000 (+0530) Subject: osd: Initializing start_offset,last_offset,offset X-Git-Tag: v13.0.2~856^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F19333%2Fhead;p=ceph.git osd: Initializing start_offset,last_offset,offset 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 --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 2fb52543e1e9..7575731a96ab 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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), diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index 5ef905898de7..936cd0393f1c 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -155,8 +155,8 @@ public: map 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 chunk_ops; CopyOp(CopyCallback *cb_, ObjectContextRef _obc, hobject_t s,