]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os,librbd: Initialize gc_end,bits,m_object_exist
authoramitkuma <amitkuma@redhat.com>
Tue, 19 Sep 2017 12:41:04 +0000 (18:11 +0530)
committeramitkuma <amitkuma@redhat.com>
Tue, 19 Sep 2017 12:41:04 +0000 (18:11 +0530)
Fixes the coverity issues:

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

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

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

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
src/librbd/io/ObjectRequest.h
src/os/bluestore/BlueStore.h
src/os/memstore/MemStore.h

index e1ec6dc61cbe0d85544cdacc013e5b6c2556e58b..b683dbf12c56d33b331ac7382f038e226a763e31 100644 (file)
@@ -294,7 +294,7 @@ protected:
   librados::ObjectWriteOperation m_write;
   uint64_t m_snap_seq;
   std::vector<librados::snap_t> m_snaps;
-  bool m_object_exist;
+  bool m_object_exist = false;
   bool m_guard = true;
 
   virtual void add_write_ops(librados::ObjectWriteOperation *wr,
index 2353141db988a39ba3c23bbc64548490d7a4e3bd..ff841e39bd2c39b4d321f41c864fe6951ea68469 100644 (file)
@@ -977,8 +977,8 @@ public:
     int64_t expected_for_release = 0;      ///< alloc units currently used by
                                            ///< compressed blobs that might
                                            ///< gone after GC
-    uint64_t gc_start_offset;              ///starting offset for GC
-    uint64_t gc_end_offset;                ///ending offset for GC
+    uint64_t gc_start_offset = 0;              ///starting offset for GC
+    uint64_t gc_end_offset = 0;                ///ending offset for GC
 
   protected:
     void process_protrusive_extents(const BlueStore::ExtentMap& extent_map, 
index e3d444798392a85c3c1819b013a4ced646a7932f..b6ed62c26898f70898e1bab1c80ae09a0c1a7290 100644 (file)
@@ -95,7 +95,7 @@ public:
   struct PageSetObject;
   struct Collection : public CollectionImpl {
     coll_t cid;
-    int bits;
+    int bits = 0;
     CephContext *cct;
     bool use_page_set;
     ceph::unordered_map<ghobject_t, ObjectRef> object_hash;  ///< for lookup