From: Jason Dillaman Date: Thu, 27 Feb 2020 01:17:44 +0000 (-0500) Subject: rbd-mirror: bootstrap should only update image name if successful X-Git-Tag: v15.1.1~153^2~17 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f2d43a39c336ea04dc3b2dd361580c1554719cc7;p=ceph.git rbd-mirror: bootstrap should only update image name if successful 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 --- diff --git a/src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc b/src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc index 41a3af62367..b4b237d044f 100644 --- a/src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc +++ b/src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc @@ -139,7 +139,7 @@ void BootstrapRequest::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; }