From: Patrick Donnelly Date: Tue, 27 May 2025 14:20:22 +0000 (-0400) Subject: mds: fix test that directory has no snaps X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c22db4e683cf2e6b0decc937e9ab92ba15d46487;p=ceph.git mds: fix test that directory has no snaps To look if the directory's first is beyond the last snap. This matches the behavior of lssnaps. Signed-off-by: Patrick Donnelly Fixes: https://tracker.ceph.com/issues/71462 --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 65033c052af7..7a9eac837827 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -9241,7 +9241,9 @@ bool Server::_dir_has_snaps(const MDRequestRef& mdr, CInode *diri) 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)