From f2d43a39c336ea04dc3b2dd361580c1554719cc7 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Wed, 26 Feb 2020 20:17:44 -0500 Subject: [PATCH] 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 --- src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.39.5