From: Ilya Dryomov Date: Sun, 20 Feb 2022 12:11:02 +0000 (+0100) Subject: rbd-mirror: manual stop should take precedence over regular stop X-Git-Tag: v18.0.0~1352^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c5b5787349e91a0fd23cd6d5e73b2a383ddd8687;p=ceph.git rbd-mirror: manual stop should take precedence over regular stop Somewhat similar to commit 0a3794e56256 ("rbd-mirror: make stop properly cancel restart"), make it so that a) if a manual stop is joined to regular stop, the stop becomes manual and b) if a regular stop is joined to a manual stop, the stop stays manual. Signed-off-by: Ilya Dryomov --- diff --git a/src/tools/rbd_mirror/ImageReplayer.cc b/src/tools/rbd_mirror/ImageReplayer.cc index ec35aa028729..b6f9b1f11265 100644 --- a/src/tools/rbd_mirror/ImageReplayer.cc +++ b/src/tools/rbd_mirror/ImageReplayer.cc @@ -528,6 +528,10 @@ void ImageReplayer::stop(Context *on_finish, bool manual, bool restart) if (!is_running_()) { running = false; + if (manual && !m_manual_stop) { + dout(10) << "marking manual" << dendl; + m_manual_stop = true; + } if (!restart && m_restart_requested) { dout(10) << "canceling restart" << dendl; m_restart_requested = false;