From: Vikhyat Umrao Date: Mon, 27 Jun 2016 18:06:09 +0000 (+0530) Subject: rbd: cleanup - Proxied operations shouldn't result X-Git-Tag: ses5-milestone5~317^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d09c9c471f40f15c14f392a93a04353ca30b1c5e;p=ceph.git rbd: cleanup - Proxied operations shouldn't result in error messages if replayed Fixes: http://tracker.ceph.com/issues/16130 Signed-off-by: Vikhyat Umrao --- diff --git a/src/librbd/operation/RenameRequest.cc b/src/librbd/operation/RenameRequest.cc index 3d23579af7e..cfd54d1d860 100644 --- a/src/librbd/operation/RenameRequest.cc +++ b/src/librbd/operation/RenameRequest.cc @@ -66,7 +66,11 @@ bool RenameRequest::should_complete(int r) { << "r=" << r << dendl; r = filter_state_return_code(r); if (r < 0) { - lderr(cct) << "encountered error: " << cpp_strerror(r) << dendl; + if (r == -EEXIST) { + ldout(cct, 1) << "image already exists" << dendl; + } else { + lderr(cct) << "encountered error: " << cpp_strerror(r) << dendl; + } return true; } diff --git a/src/librbd/operation/SnapshotProtectRequest.cc b/src/librbd/operation/SnapshotProtectRequest.cc index 9ba415e4cf9..409d9983c40 100644 --- a/src/librbd/operation/SnapshotProtectRequest.cc +++ b/src/librbd/operation/SnapshotProtectRequest.cc @@ -47,7 +47,11 @@ bool SnapshotProtectRequest::should_complete(int r) { ldout(cct, 5) << this << " " << __func__ << ": state=" << m_state << ", " << "r=" << r << dendl; if (r < 0) { - lderr(cct) << "encountered error: " << cpp_strerror(r) << dendl; + if (r == -EBUSY) { + ldout(cct, 1) << "snapshot is already protected" << dendl; + } else { + lderr(cct) << "encountered error: " << cpp_strerror(r) << dendl; + } } return true; } diff --git a/src/librbd/operation/SnapshotRemoveRequest.cc b/src/librbd/operation/SnapshotRemoveRequest.cc index 9bc45679896..eadbfc2a106 100644 --- a/src/librbd/operation/SnapshotRemoveRequest.cc +++ b/src/librbd/operation/SnapshotRemoveRequest.cc @@ -135,7 +135,11 @@ void SnapshotRemoveRequest::send_remove_child() { parent_spec our_pspec; int r = image_ctx.get_parent_spec(m_snap_id, &our_pspec); if (r < 0) { - lderr(cct) << "failed to retrieve parent spec" << dendl; + if (r == -ENOENT) { + ldout(cct, 1) << "No such snapshot" << dendl; + } else { + lderr(cct) << "failed to retrieve parent spec" << dendl; + } m_state = STATE_ERROR; this->async_complete(r); diff --git a/src/librbd/operation/SnapshotRenameRequest.cc b/src/librbd/operation/SnapshotRenameRequest.cc index 209a46c80bf..7f7db84592e 100644 --- a/src/librbd/operation/SnapshotRenameRequest.cc +++ b/src/librbd/operation/SnapshotRenameRequest.cc @@ -49,7 +49,11 @@ bool SnapshotRenameRequest::should_complete(int r) { ldout(cct, 5) << this << " " << __func__ << ": state=" << m_state << ", " << "r=" << r << dendl; if (r < 0) { - lderr(cct) << "encountered error: " << cpp_strerror(r) << dendl; + if (r == -EEXIST) { + ldout(cct, 1) << "snapshot already exists" << dendl; + } else { + lderr(cct) << "encountered error: " << cpp_strerror(r) << dendl; + } } return true; } diff --git a/src/librbd/operation/SnapshotUnprotectRequest.cc b/src/librbd/operation/SnapshotUnprotectRequest.cc index 5ca98f9d80a..0b7b7c4382b 100644 --- a/src/librbd/operation/SnapshotUnprotectRequest.cc +++ b/src/librbd/operation/SnapshotUnprotectRequest.cc @@ -169,7 +169,11 @@ bool SnapshotUnprotectRequest::should_complete(int r) { ldout(cct, 5) << this << " " << __func__ << ": state=" << m_state << ", " << "r=" << r << dendl; if (r < 0) { - lderr(cct) << "encountered error: " << cpp_strerror(r) << dendl; + if (r == -EINVAL) { + ldout(cct, 1) << "snapshot is already unprotected" << dendl; + } else { + lderr(cct) << "encountered error: " << cpp_strerror(r) << dendl; + } if (m_ret_val == 0) { m_ret_val = r; }