]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: uninitialized state in snap remove state machine 6982/head
authorJason Dillaman <dillaman@redhat.com>
Fri, 18 Dec 2015 21:40:35 +0000 (16:40 -0500)
committerJason Dillaman <dillaman@redhat.com>
Fri, 18 Dec 2015 21:41:21 +0000 (16:41 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/operation/SnapshotRemoveRequest.cc
src/librbd/operation/SnapshotRemoveRequest.h

index a227be446f3b3b5c5a615198eed380247cf5693e..4893ad1c942ebed60589597d961b597f150976a2 100644 (file)
@@ -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;
@@ -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;
     }
index ea950a55d3571c3f7d19d2443b2de6543a4ce54f..48e14ae74f837512ce0a4fbeb79a5e08dd536c41 100644 (file)
@@ -52,7 +52,8 @@ public:
     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,