]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: Initialize on_finish,locker,force,snap_id 17800/head
authoramitkuma <amitkuma@redhat.com>
Tue, 19 Sep 2017 14:15:48 +0000 (19:45 +0530)
committeramitkuma <amitkuma@redhat.com>
Tue, 19 Sep 2017 14:15:48 +0000 (19:45 +0530)
** 396154 Uninitialized pointer field
CID 1396154 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
2. uninit_member: Non-static class member on_finish is not initialized
in this constructor nor in any functions that it calls.

** 1396158 Uninitialized pointer field
2. uninit_member: Non-static class member snap_id is not initialized
in this constructor nor in any functions that it calls.
4. uninit_member: Non-static class member force is not initialized
in this constructor nor in any functions that it calls.
CID 1396158 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
6. uninit_member: Non-static class member on_finish is not initialized
in this constructor nor in any functions that it calls.

** 1399593 Uninitialized pointer field
2. uninit_member: Non-static class member locker is not initialized
in this constructor nor in any functions that it calls.
CID 1399593 (#2 of 2): Uninitialized pointer field (UNINIT_CTOR)
4. uninit_member: Non-static class member on_finish is not initialized
in this constructor nor in any functions that it calls.

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
src/test/librbd/exclusive_lock/test_mock_PostAcquireRequest.cc
src/test/librbd/managed_lock/test_mock_AcquireRequest.cc
src/test/librbd/object_map/mock/MockInvalidateRequest.h

index b78521287d228f9329f5eaad47f81dcf1a0336ed..0f47a75043da3da48dbf41c6f11ebe939a6520d2 100644 (file)
@@ -37,7 +37,7 @@ namespace image {
 template<>
 struct RefreshRequest<librbd::MockTestImageCtx> {
   static RefreshRequest *s_instance;
-  Context *on_finish;
+  Context *on_finish = nullptr;
 
   static RefreshRequest *create(librbd::MockTestImageCtx &image_ctx,
                                 bool acquire_lock_refresh,
index 8f2f5f6ef2774bf5566e195e473358a5e1008a58..32ecc747ad1e0a933ed3120e8f587db6c8010429 100644 (file)
@@ -52,8 +52,8 @@ struct BreakRequest<librbd::MockImageCtx> {
 
 template <>
 struct GetLockerRequest<librbd::MockImageCtx> {
-  Locker *locker;
-  Context *on_finish;
+  Locker *locker = nullptr;
+  Context *on_finish = nullptr;
 
   static GetLockerRequest *s_instance;
   static GetLockerRequest* create(librados::IoCtx& ioctx,
index 106745f9a8bc91ee27f62cd46e210260867b0081..0702264449011d5d5f3295a0763e396c8a21e0b5 100644 (file)
@@ -12,9 +12,9 @@ namespace object_map {
 template <typename I>
 struct MockInvalidateRequestBase {
   static std::list<InvalidateRequest<I>*> s_requests;
-  uint64_t snap_id;
-  bool force;
-  Context *on_finish;
+  uint64_t snap_id = 0;
+  bool force = false;
+  Context *on_finish = nullptr;
 
   static InvalidateRequest<I>* create(I &image_ctx, uint64_t snap_id,
                                       bool force, Context *on_finish) {