From: Shweta Bhosale Date: Wed, 17 Jun 2026 10:18:07 +0000 (+0530) Subject: mgr/nfs: read full conf object when removing export URL X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=488c7fdf0940edadbbb2b38c5099cc0e9c9d2348;p=ceph.git mgr/nfs: read full conf object when removing export URL 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 --- diff --git a/src/pybind/mgr/nfs/rados_utils.py b/src/pybind/mgr/nfs/rados_utils.py index e8af2c71680..37e4ae683fb 100644 --- a/src/pybind/mgr/nfs/rados_utils.py +++ b/src/pybind/mgr/nfs/rados_utils.py @@ -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)