From 8f2ee228af0fa0723328c0cf5c7e85906be8e287 Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Tue, 13 Feb 2024 12:02:27 +0000 Subject: [PATCH] osd/SnapMapper: fix _lookup_purged_snap We should verify that the snap we are looking for matches the pool also. Same as we are checking in OSDMonitor: https://github.com/ceph/ceph/pull/28865/commits/0a48392ce066471233cc1e81e957b2999b9c411c Fixes: https://tracker.ceph.com/issues/64347 Signed-off-by: Matan Breizman --- src/osd/SnapMapper.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osd/SnapMapper.cc b/src/osd/SnapMapper.cc index e79bc5d450a24..1d3bfa95b9a61 100644 --- a/src/osd/SnapMapper.cc +++ b/src/osd/SnapMapper.cc @@ -764,6 +764,10 @@ int SnapMapper::_lookup_purged_snap( decode(gotpool, p); decode(*begin, p); decode(*end, p); + if (gotpool != pool) { + dout(20) << __func__ << " got wrong pool " << gotpool << dendl; + return -ENOENT; + } if (snap < *begin || snap >= *end) { dout(20) << __func__ << " pool " << pool << " snap " << snap << " found [" << *begin << "," << *end << "), no overlap" << dendl; -- 2.39.5