]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs.pyx: use fdopendir() in rmtree()
authorRishabh Dave <ridave@redhat.com>
Thu, 23 Oct 2025 11:26:16 +0000 (16:56 +0530)
committerRishabh Dave <ridave@redhat.com>
Wed, 26 Nov 2025 13:25:13 +0000 (18:55 +0530)
Fixes: https://tracker.ceph.com/issues/72992
Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/pybind/cephfs/cephfs.pyx

index ca005bf11ba49f20aedbeb3be357bcabb2057b91..72c1d824835856431c55e8504726348c15d4f333 100644 (file)
@@ -3097,7 +3097,8 @@ class RmtreeDir:
 
         # XXX: exception (if) raised here should be handled by caller based on
         # the context.
-        self.handle = self.fs.opendir(self.path)
+        self.fd = self.fs.open(self.rel_path, os.O_RDONLY | os.O_DIRECTORY, 0o755)
+        self.handle = self.fs.fdopendir(self.fd)
 
         # Is this directory empty? It will be set by self.read_dir().
         self.is_empty = None