From 4cd9bb2b05c22939749123683d7a6af28a6afa31 Mon Sep 17 00:00:00 2001 From: Li Wang Date: Sat, 7 Oct 2017 03:34:23 +0000 Subject: [PATCH] librbd/operation/SnapshotProtectRequest: fix uninitialized member Silence Coverity 1413777 Signed-off-by: Li Wang --- src/librbd/operation/SnapshotProtectRequest.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/librbd/operation/SnapshotProtectRequest.cc b/src/librbd/operation/SnapshotProtectRequest.cc index 199432196ef19..018155d7aff41 100644 --- a/src/librbd/operation/SnapshotProtectRequest.cc +++ b/src/librbd/operation/SnapshotProtectRequest.cc @@ -33,7 +33,8 @@ SnapshotProtectRequest::SnapshotProtectRequest(I &image_ctx, Context *on_finish, const cls::rbd::SnapshotNamespace &snap_namespace, const std::string &snap_name) - : Request(image_ctx, on_finish), m_snap_namespace(snap_namespace), m_snap_name(snap_name) { + : Request(image_ctx, on_finish), m_snap_namespace(snap_namespace), + m_snap_name(snap_name), m_state(STATE_PROTECT_SNAP) { } template @@ -65,8 +66,6 @@ void SnapshotProtectRequest::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);