]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: Initialization of state inside module 16866/head
authoramitkuma <amitkuma@redhat.com>
Mon, 7 Aug 2017 17:31:12 +0000 (23:01 +0530)
committeramitkuma <amitkuma@redhat.com>
Mon, 7 Aug 2017 17:31:12 +0000 (23:01 +0530)
Fixes the coverity issues:

** 1351715 Uninitialized scalar field
5. uninit_member: Non-static class member m_state is not initialized in this
constructor nor in any functions that it calls.
7. uninit_member: Non-static class member m_copyup_start is not initialized
in this constructor nor in any functions that it calls.
CID 1351715 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
9. uninit_member: Non-static class member m_copyup_end is not initialized
in this constructor nor in any functions that it calls.

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

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

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

Signed-off-by: Amit Kumar amitkuma@redhat.com
src/librbd/object_map/SnapshotCreateRequest.h
src/librbd/object_map/SnapshotRemoveRequest.h
src/librbd/object_map/SnapshotRollbackRequest.h
src/librbd/operation/TrimRequest.h

index 31a0886883aac059f43df4b65e7f0a3da179c4de..dd15abefa931f04a2db835938d507efdd9a729aa 100644 (file)
@@ -56,7 +56,7 @@ protected:
   bool should_complete(int r) override;
 
 private:
-  State m_state;
+  State m_state = STATE_READ_MAP;
   ceph::BitVector<2> &m_object_map;
 
   bufferlist m_read_bl;
index 6f9e85c48f182c358caefbd4ca0fb74cb2b1e4df..a6dea08e1efb064c2c6cd9395bd0d4982c500eba 100644 (file)
@@ -66,7 +66,7 @@ protected:
   }
 
 private:
-  State m_state;
+  State m_state = STATE_LOAD_MAP;
   ceph::BitVector<2> &m_object_map;
   uint64_t m_snap_id;
   uint64_t m_next_snap_id;
index 47d7116cb4ba5e0268037bd365c4d376be22042e..c62849e8564c276e99b4c7f4cdb6d62698997d53 100644 (file)
@@ -56,7 +56,7 @@ protected:
   bool should_complete(int r) override;
 
 private:
-  State m_state;
+  State m_state = STATE_READ_MAP;
   uint64_t m_snap_id;
   int m_ret_val;
 
index 5eb9fdffe3868b47f58a002b5c5177f49eda6be4..2867cf5b08fb2d931aa1e7aeb15fc430cefd4857 100644 (file)
@@ -79,7 +79,7 @@ protected:
 
   bool should_complete(int r) override;
 
-  State m_state;
+  State m_state = STATE_PRE_COPYUP;
 
 private:
   uint64_t m_delete_start;
@@ -88,8 +88,8 @@ private:
   uint64_t m_new_size;
   ProgressContext &m_prog_ctx;
 
-  uint64_t m_copyup_start;
-  uint64_t m_copyup_end;
+  uint64_t m_copyup_start = 0;
+  uint64_t m_copyup_end = 0;
 
   TrimRequest(ImageCtxT &image_ctx, Context *on_finish,
              uint64_t original_size, uint64_t new_size,