Skip to content

Commit

Permalink
Merge pull request #6982 from dillaman/wip-librbd-valgrind
Browse files Browse the repository at this point in the history
librbd: uninitialized state in snap remove state machine

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
  • Loading branch information
jdurgin committed Dec 18, 2015
2 parents 28081d7 + 6d9da6a commit a2befde
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/librbd/operation/SnapshotRemoveRequest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ std::ostream& operator<<(std::ostream& os,
case SnapshotRemoveRequest<I>::STATE_RELEASE_SNAP_ID:
os << "RELEASE_SNAP_ID";
break;
case SnapshotRemoveRequest<I>::STATE_ERROR:
os << "STATE_ERROR";
break;
default:
os << "UNKNOWN (" << static_cast<uint32_t>(state) << ")";
break;
Expand Down Expand Up @@ -127,6 +130,8 @@ void SnapshotRemoveRequest<I>::send_remove_child() {
int r = image_ctx.get_parent_spec(m_snap_id, &our_pspec);
if (r < 0) {
lderr(cct) << "failed to retrieve parent spec" << dendl;
m_state = STATE_ERROR;

this->async_complete(r);
return;
}
Expand Down
3 changes: 2 additions & 1 deletion src/librbd/operation/SnapshotRemoveRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class SnapshotRemoveRequest : public Request<ImageCtxT> {
STATE_REMOVE_OBJECT_MAP,
STATE_REMOVE_CHILD,
STATE_REMOVE_SNAP,
STATE_RELEASE_SNAP_ID
STATE_RELEASE_SNAP_ID,
STATE_ERROR
};

SnapshotRemoveRequest(ImageCtxT &image_ctx, Context *on_finish,
Expand Down

0 comments on commit a2befde

Please sign in to comment.