Skip to content

Commit

Permalink
Merge pull request #11461 from dachary/wip-17481-jewel
Browse files Browse the repository at this point in the history
jewel: Proxied operations shouldn't result in error messages if replayed

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
  • Loading branch information
Loic Dachary committed Oct 20, 2016
2 parents 410a368 + dd93e00 commit cd48521
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 @@ -64,7 +64,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 cd48521

Please sign in to comment.