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

dragonylffly
Copy link
Contributor

No description provided.

Copy link

@dillaman dillaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 wip-fix-coverity-warning-for-uninialized-member branch from 0087ce9 to b09ba9a Compare October 6, 2017 14:46
@dragonylffly
Copy link
Contributor Author

@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) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Silence Coverity 1413777

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

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

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

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

Signed-off-by: Li Wang <laurence.liwang@gmail.com>
@dragonylffly dragonylffly force-pushed the wip-fix-coverity-warning-for-uninialized-member branch from b09ba9a to 2a8e8c5 Compare October 7, 2017 04:03
@dragonylffly
Copy link
Contributor Author

@dillaman updated

Copy link

@dillaman dillaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants