]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: bootstrap should only update image name if successful
authorJason Dillaman <dillaman@redhat.com>
Thu, 27 Feb 2020 01:17:44 +0000 (20:17 -0500)
committerJason Dillaman <dillaman@redhat.com>
Thu, 27 Feb 2020 21:33:21 +0000 (16:33 -0500)
If we failed to retrieve the local image name during the prepare step, don't
store an empty image name in our cached image name state variable.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc

index 41a3af62367d1042d4a51624d1537b9c2f1eafd3..b4b237d044f428a6197a791833f4fae82e35ba71 100644 (file)
@@ -139,7 +139,7 @@ void BootstrapRequest<I>::handle_prepare_local_image(int r) {
 
   // image replayer will detect the name change (if any) at next
   // status update
-  {
+  if (r >= 0 && !m_prepare_local_image_name.empty()) {
     std::unique_lock locker{m_lock};
     m_local_image_name = m_prepare_local_image_name;
   }