]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/cephfs: don't attempt to unlink root in rmtree
authorRishabh Dave <ridave@redhat.com>
Mon, 6 Apr 2026 06:26:23 +0000 (11:56 +0530)
committerRishabh Dave <ridave@redhat.com>
Thu, 16 Apr 2026 12:41:08 +0000 (18:11 +0530)
Don't attempt to unlink '/' as part of recursive delete when rmtree('/')
is called as it is an invalid op.

Fixes: https://tracker.ceph.com/issues/75924
Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/pybind/cephfs/cephfs.pyx

index 337b2e0b4182885952d4bc76e011e61936e1fcf1..650beacb9754330335c055b50926e465773516cc 100644 (file)
@@ -3432,6 +3432,9 @@ class RmtreeDir:
         and tell caller whether to continue or break loop based through the
         return value.
         '''
+        if self.name == b'/':
+            return
+
         try:
             self.fs.unlinkat(self.parent_dir_fd, self.name, AT_REMOVEDIR)