From 2622830c75af3241d516aa25492141bce7c76220 Mon Sep 17 00:00:00 2001 From: amitkuma Date: Tue, 5 Dec 2017 21:01:52 +0530 Subject: [PATCH] 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 --- src/osd/PrimaryLogPG.cc | 2 +- src/osd/PrimaryLogPG.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 2fb52543e1e..7575731a96a 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 5ef905898de..936cd0393f1 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, -- 2.47.3