From: Matan Breizman Date: Tue, 13 Feb 2024 12:02:27 +0000 (+0000) Subject: osd/SnapMapper: fix _lookup_purged_snap X-Git-Tag: v19.1.0~67^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f45d9c30fa7e6931d946806ab6eb0f23756afb1c;p=ceph.git 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 (cherry picked from commit 8f2ee228af0fa0723328c0cf5c7e85906be8e287) --- diff --git a/src/osd/SnapMapper.cc b/src/osd/SnapMapper.cc index e79bc5d450a2..1d3bfa95b9a6 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;