To look if the directory's first is beyond the last snap. This matches the behavior of lssnaps.
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
Fixes: https://tracker.ceph.com/issues/71462
ceph_assert(diri->snaplock.can_read(mdr->get_client()));
SnapRealm *realm = diri->find_snaprealm();
- return !realm->get_snaps().empty();
+ auto& snaps = realm->get_snaps();
+ auto it = snaps.lower_bound(diri->get_oldest_snap());
+ return it != snaps.end();
}
bool Server::_dir_is_nonempty(const MDRequestRef& mdr, CInode *in)