Skip to content

Commit

Permalink
librbd/operation/SnapshotProtectRequest: fix uninitialized member
Browse files Browse the repository at this point in the history
Silence Coverity 1413777

Signed-off-by: Li Wang <[email protected]>
  • Loading branch information
dragonylffly committed Oct 7, 2017
1 parent f9cfe84 commit 4cd9bb2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/librbd/operation/SnapshotProtectRequest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ 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) {
}

template <typename I>
Expand Down Expand Up @@ -65,8 +66,6 @@ void SnapshotProtectRequest<I>::send_protect_snap() {
CephContext *cct = image_ctx.cct;
ldout(cct, 5) << this << " " << __func__ << dendl;

m_state = STATE_PROTECT_SNAP;

int r = verify_and_send_protect_snap();
if (r < 0) {
this->async_complete(r);
Expand Down

0 comments on commit 4cd9bb2

Please sign in to comment.