From 750c1147b061e6491b2d75cda07289166b4bce69 Mon Sep 17 00:00:00 2001 From: Sun Yuechi Date: Mon, 6 Jul 2026 19:01:05 -0700 Subject: [PATCH] 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) --- src/tools/rbd_mirror/image_replayer/PrepareLocalImageRequest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 << ", " -- 2.47.3