]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd/mirror: detect trashed snapshots in UnlinkPeerRequest 67583/head
authorIlya Dryomov <idryomov@gmail.com>
Tue, 24 Feb 2026 11:46:35 +0000 (12:46 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Sat, 28 Feb 2026 21:09:15 +0000 (22:09 +0100)
commit9584237f2fbc59f62b20b0f263fcdfc20ea1cb07
treef8757f0a81f2427262152910a251cea22a1ad12d
parentf7b1ebb734adfb2597e18f579660e02cd19ded7f
librbd/mirror: detect trashed snapshots in UnlinkPeerRequest

If two instances of UnlinkPeerRequest race with each other (e.g. due
to rbd-mirror daemon unlinking from a previous mirror snapshot and the
user taking another mirror snapshot at same time), the snapshot that
UnlinkPeerRequest was created for may be in the process of being removed
(which may mean trashed by SnapshotRemoveRequest::trash_snap()) or fully
removed by the time unlink_peer() grabs the image lock.  Because trashed
snapshots weren't handled explicitly, UnlinkPeerRequest could spuriously
fail with EINVAL ("not mirror snapshot" case) instead of the expected
ENOENT ("missing snapshot" case).  This in turn could lead to spurious
ImageReplayer failures with it stopping prematurely.

Fixes: https://tracker.ceph.com/issues/68279
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 3596ca077097a4e0ff8e8d05a410c2044332391e)
src/librbd/mirror/snapshot/UnlinkPeerRequest.cc
src/test/librbd/mirror/snapshot/test_mock_UnlinkPeerRequest.cc