Skip to content

Commit

Permalink
rbd: cleanup - Proxied operations shouldn't result
Browse files Browse the repository at this point in the history
in error messages if replayed

Fixes: http://tracker.ceph.com/issues/16130

Signed-off-by: Vikhyat Umrao <vumrao@redhat.com>
  • Loading branch information
vumrao committed Jun 29, 2016
1 parent ee7949f commit de2441b
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/librbd/operation/RenameRequest.cc
Expand Up @@ -66,7 +66,11 @@ bool RenameRequest<I>::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;
}

Expand Down
6 changes: 5 additions & 1 deletion src/librbd/operation/SnapshotProtectRequest.cc
Expand Up @@ -47,7 +47,11 @@ bool SnapshotProtectRequest<I>::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;
}
Expand Down
6 changes: 5 additions & 1 deletion src/librbd/operation/SnapshotRemoveRequest.cc
Expand Up @@ -135,7 +135,11 @@ void SnapshotRemoveRequest<I>::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);
Expand Down
6 changes: 5 additions & 1 deletion src/librbd/operation/SnapshotRenameRequest.cc
Expand Up @@ -49,7 +49,11 @@ bool SnapshotRenameRequest<I>::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;
}
Expand Down
6 changes: 5 additions & 1 deletion src/librbd/operation/SnapshotUnprotectRequest.cc
Expand Up @@ -169,7 +169,11 @@ bool SnapshotUnprotectRequest<I>::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;
}
Expand Down

0 comments on commit de2441b

Please sign in to comment.