From: Sun Yuechi Date: Tue, 7 Jul 2026 02:01:05 +0000 (-0700) Subject: rbd-mirror: return after finishing on unsupported mirror mode X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=750c1147b061e6491b2d75cda07289166b4bce69;p=ceph.git rbd-mirror: return after finishing on unsupported mirror mode The mirror-mode switch default in handle_get_mirror_info() calls finish(-EOPNOTSUPP), which deletes this, then breaks and falls through to the common code, dereferencing the null *m_state_builder and freeing the request a second time. Fixes: https://tracker.ceph.com/issues/78043 Signed-off-by: Sun Yuechi (cherry picked from commit 9759952725a8bdfba6eab10979678dce90cc088d) --- diff --git a/src/tools/rbd_mirror/image_replayer/PrepareLocalImageRequest.cc b/src/tools/rbd_mirror/image_replayer/PrepareLocalImageRequest.cc index 025c2a3dcd41..5b1e1ba7a77d 100644 --- a/src/tools/rbd_mirror/image_replayer/PrepareLocalImageRequest.cc +++ b/src/tools/rbd_mirror/image_replayer/PrepareLocalImageRequest.cc @@ -153,7 +153,7 @@ void PrepareLocalImageRequest::handle_get_mirror_info(int r) { derr << "unsupported mirror image mode " << m_mirror_image.mode << " " << "for image " << m_global_image_id << dendl; finish(-EOPNOTSUPP); - break; + return; } dout(10) << "local_image_id=" << m_local_image_id << ", "