From 488c7fdf0940edadbbb2b38c5099cc0e9c9d2348 Mon Sep 17 00:00:00 2001 From: Shweta Bhosale Date: Wed, 17 Jun 2026 15:48:07 +0530 Subject: [PATCH] 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 --- src/pybind/mgr/nfs/rados_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.47.3