From: Rishabh Dave Date: Mon, 6 Apr 2026 06:26:23 +0000 (+0530) Subject: pybind/cephfs: don't attempt to unlink root in rmtree X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=defbc0651e44b00060cdcf11b28c714f189b1c72;p=ceph.git pybind/cephfs: don't attempt to unlink root in rmtree 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 --- diff --git a/src/pybind/cephfs/cephfs.pyx b/src/pybind/cephfs/cephfs.pyx index 337b2e0b4182..650beacb9754 100644 --- a/src/pybind/cephfs/cephfs.pyx +++ b/src/pybind/cephfs/cephfs.pyx @@ -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)