New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

messages: Initialize member variables #16819

Merged
merged 1 commit into from Aug 5, 2017

Conversation

Projects
None yet
3 participants
@amitkumar50
Contributor

amitkumar50 commented Aug 4, 2017

Fixes coverity Issue:

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

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

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

  1. uninit_member: Non-static class member op is not initialized in this constructor nor in any functions that it calls.
  2. uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
    CID 717313 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  3. uninit_member: Non-static class member query_epoch is not initialized in this constructor nor in any functions that it calls.

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

  1. uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
    CID 717316 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  2. uninit_member: Non-static class member op is not initialized in this constructor nor in any functions that it calls.
  1. uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
    CID 717317 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  2. uninit_member: Non-static class member min_epoch is not initialized in this constructor nor in any functions that it calls.
  3. uninit_member: Non-static class member repair is not initialized in this constructor nor in any functions that it calls.

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

  1. uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
  2. uninit_member: Non-static class member acks_wanted is not initialized in this constructor nor in any functions that it calls.
  3. uninit_member: Non-static class member old_exists is not initialized in this constructor nor in any functions that it calls.
  4. uninit_member: Non-static class member old_size is not initialized in this constructor nor in any functions that it calls.
  5. uninit_member: Non-static class member first is not initialized in this constructor nor in any functions that it calls.
    CID 717319 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  6. uninit_member: Non-static class member complete is not initialized in this constructor nor in any functions that it calls.
  1. uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
  2. uninit_member: Non-static class member ack_type is not initialized in this constructor nor in any functions that it calls.
    CID 717320 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  3. uninit_member: Non-static class member result is not initialized in this constructor nor in any functions that it calls.
    CID 717321 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  4. uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls
  5. uninit_member: Non-static class member pool is not initialized in this constructor nor in any functions that it calls.
  6. uninit_member: Non-static class member op is not initialized in this constructor nor in any functions that it calls.
  7. uninit_member: Non-static class member auid is not initialized in this constructor nor in any functions that it calls.
    CID 717322 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  8. uninit_member: Non-static class member crush_rule is not initialized in this constructor nor in any functions that it calls.
  1. uninit_member: Non-static class member replyCode is not initialized in this constructor nor in any functions that it calls.
    CID 717323 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  2. uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Amit Kumar amitkuma@redhat.com

@joscollin joscollin self-requested a review Aug 4, 2017

bool repair;
bool deep;
bool repair = 0;
bool deep = 0;

This comment has been minimized.

@gregsfortytwo

gregsfortytwo Aug 4, 2017

Member

shouldn't we initialize bools with true/false values?

// op to exec
vector<OSDOp> ops;
utime_t mtime;
bool old_exists;
uint64_t old_size;
bool old_exists = 0;

This comment has been minimized.

@gregsfortytwo

gregsfortytwo Aug 4, 2017

Member

another bool

@@ -71,7 +71,7 @@ class MOSDSubOp : public MOSDFastDispatchOp {
interval_set<uint64_t> data_subset;
map<hobject_t, interval_set<uint64_t>> clone_subsets;
bool first, complete;
bool first = 0, complete = 0;

This comment has been minimized.

@gregsfortytwo

gregsfortytwo Aug 4, 2017

Member

more bool

@joscollin

From next time onwards, please submit each coverity fixes as separate commits, so that it would be easier for the reviewer to identify the fix corresponding to the coverity description (from the commit message).

@joscollin

Divide into multiple commits and you won't miss out.

@@ -44,7 +44,7 @@ class MOSDSubOpReply : public MOSDFastDispatchOp {
vector<OSDOp> ops;
// result
__u8 ack_type;
__u8 ack_type = 0;
int32_t result;

This comment has been minimized.

@joscollin

joscollin Aug 5, 2017

Member

Missed result

string name;
__u32 op;
uint64_t auid;

This comment has been minimized.

@joscollin

joscollin Aug 5, 2017

Member

missed op

@amitkumar50

This comment has been minimized.

Contributor

amitkumar50 commented Aug 5, 2017

@gregsfortytwo @joscollin Thanks for Comments. Done Changes!!!

Verified that the changes suggested by Greg are made

@joscollin joscollin changed the title from messages: Initializing member variables of module messages to messages: Initialize member variables Aug 5, 2017

@joscollin joscollin merged commit bb19021 into ceph:master Aug 5, 2017

4 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
make check (arm64) make check succeeded
Details
messages: Initializing member variables of module messages
Fixes coverity Issue:

CID 717307 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls.
2. uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls.
CID 717308 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
4. uninit_member: Non-static class member query_epoch is not initialized in this constructor nor in any functions that it calls.
CID 717310 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls.
CID 717311 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls.
CID 717312 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member op is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
CID 717313 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member query_epoch is not initialized in this constructor nor in any functions that it calls.
CID 717314 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
CID 717315 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
CID 717316 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member op is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
CID 717317 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member min_epoch is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member repair is not initialized in this constructor nor in any functions that it calls.
CID 717318 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
4. uninit_member: Non-static class member deep is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member acks_wanted is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member old_exists is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member old_size is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member first is not initialized in this constructor nor in any functions that it calls.
CID 717319 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member complete is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member ack_type is not initialized in this constructor nor in any functions that it calls.
CID 717320 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member result is not initialized in this constructor nor in any functions that it calls.
CID 717321 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls
uninit_member: Non-static class member pool is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member op is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member auid is not initialized in this constructor nor in any functions that it calls.
CID 717322 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member crush_rule is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member replyCode is not initialized in this constructor nor in any functions that it calls.
CID 717323 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Amit Kumar amitkuma@redhat.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment