]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/SnapMapper: fix _lookup_purged_snap 55562/head
authorMatan Breizman <mbreizma@redhat.com>
Tue, 13 Feb 2024 12:02:27 +0000 (12:02 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Tue, 13 Feb 2024 12:04:53 +0000 (12:04 +0000)
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 <mbreizma@redhat.com>
src/osd/SnapMapper.cc

index e79bc5d450a2402de76a1568ad57d9354fb94c5d..1d3bfa95b9a61e110bf97da7f3ffc7d81d013878 100644 (file)
@@ -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;