]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/nfs: read full conf object when removing export URL 69541/head
authorShweta Bhosale <Shweta.Bhosale1@ibm.com>
Wed, 17 Jun 2026 10:18:07 +0000 (15:48 +0530)
committerShweta Bhosale <Shweta.Bhosale1@ibm.com>
Wed, 17 Jun 2026 10:19:08 +0000 (15:49 +0530)
remove_obj() called ioctx.read() without a length, so only the first
8192 bytes of conf-nfs.* were read before write_full(). Removing exports
from a large cluster truncated and corrupted the shared config object,
leaving malformed entries such as '%url "rados:' while export objects
were deleted.

Fixes: https://tracker.ceph.com/issues/77463
Signed-off-by: Shweta Bhosale <Shweta.Bhosale1@ibm.com>
src/pybind/mgr/nfs/rados_utils.py

index e8af2c71680850669ed05a674ed5215392569e9c..37e4ae683fbb8b60625fe827094adf17fa05ca23 100644 (file)
@@ -72,7 +72,8 @@ class NFSRados:
     def remove_obj(self, obj: str, config_obj: str, should_notify: Optional[bool] = True) -> None:
         with self.rados.open_ioctx(self.pool) as ioctx:
             ioctx.set_namespace(self.namespace)
-            export_urls = ioctx.read(config_obj)
+            size, _ = ioctx.stat(config_obj)
+            export_urls = ioctx.read(config_obj, size)
             url = '%url "{}"\n\n'.format(self._make_rados_url(obj))
             export_urls = export_urls.replace(url.encode('utf-8'), b'')
             ioctx.remove_object(obj)