Skip to content
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

librbd: fix coverity warning for uninitialized member #18129

Conversation

Projects
None yet
2 participants
@dragonylffly
Copy link
Contributor

commented Oct 5, 2017

No description provided.

@dillaman
Copy link
Contributor

left a comment

The newly added states are not needed -- you could just default to the first state assignment.

@dillaman dillaman changed the title rbd: fix coverity warning for uninitialized member librbd: fix coverity warning for uninitialized member Oct 5, 2017

@dragonylffly dragonylffly force-pushed the dragonylffly:wip-fix-coverity-warning-for-uninialized-member branch from 0087ce9 to b09ba9a Oct 6, 2017

@dragonylffly

This comment has been minimized.

Copy link
Contributor Author

commented Oct 6, 2017

@dillaman updated

@@ -33,7 +33,7 @@ SnapshotProtectRequest<I>::SnapshotProtectRequest(I &image_ctx,
Context *on_finish,
const cls::rbd::SnapshotNamespace &snap_namespace,
const std::string &snap_name)
: Request<I>(image_ctx, on_finish), m_snap_namespace(snap_namespace), m_snap_name(snap_name) {
: Request<I>(image_ctx, on_finish), m_snap_namespace(snap_namespace), m_snap_name(snap_name), m_state(STATE_PROTECT_SNAP) {

This comment has been minimized.

Copy link
@dillaman

dillaman Oct 6, 2017

Contributor

Nit: wrap it down to the next line (with proper indentation) before it exceeds 80 characters

@@ -102,7 +102,7 @@ class MetadataCopyRequest<librbd::MockTestImageCtx> {
return s_instance;
}

MetadataCopyRequest() {
MetadataCopyRequest() : on_finish(nullptr) {

This comment has been minimized.

Copy link
@dillaman

dillaman Oct 6, 2017

Contributor

Nit: default initialize to nullptr inline where the variable is defined.

dragonylffly added some commits Oct 7, 2017

librbd/operation/SnapshotProtectRequest: fix uninitialized member
Silence Coverity 1413777

Signed-off-by: Li Wang <laurence.liwang@gmail.com>
librbd/operation/SnapshotRemoveRequest: fix uninitialized member
Silence coverity 1413790

Signed-off-by: Li Wang <laurence.liwang@gmail.com>
librbd/operation/SnapshotRenameRequest: fix uninitialized member
Silence coverity 1396229

Signed-off-by: Li Wang <laurence.liwang@gmail.com>
librbd/operation/SnapshotUnprotectRequest: fix uninitialized member
Silence coverity 1413793

Signed-off-by: Li Wang <laurence.liwang@gmail.com>
test/rbd_mirror/test_mock_ImageSync: fix uninitialized member
Silence coverity 1418957

Signed-off-by: Li Wang <laurence.liwang@gmail.com>

@dragonylffly dragonylffly force-pushed the dragonylffly:wip-fix-coverity-warning-for-uninialized-member branch from b09ba9a to 2a8e8c5 Oct 7, 2017

@dragonylffly

This comment has been minimized.

Copy link
Contributor Author

commented Oct 7, 2017

@dillaman updated

@dillaman
Copy link
Contributor

left a comment

lgtm

@dillaman dillaman merged commit 78e5c0f into ceph:master Oct 16, 2017

4 of 5 checks passed

Docs: build check Docs: failed with errors
Details
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.