]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: return after finishing on unsupported mirror mode 70592/head
authorSun Yuechi <sunyuechi@iscas.ac.cn>
Tue, 7 Jul 2026 02:01:05 +0000 (19:01 -0700)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 27 Jul 2026 18:08:59 +0000 (20:08 +0200)
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 <sunyuechi@iscas.ac.cn>
(cherry picked from commit 9759952725a8bdfba6eab10979678dce90cc088d)

src/tools/rbd_mirror/image_replayer/PrepareLocalImageRequest.cc

index 025c2a3dcd41a6a0bc123539671779cc13d3a959..5b1e1ba7a77df56e917c4979b09720fc7e086f5b 100644 (file)
@@ -153,7 +153,7 @@ void PrepareLocalImageRequest<I>::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 << ", "