From 5253e1b7fb899b50911f4d1578768323629e5d34 Mon Sep 17 00:00:00 2001 From: dparmar18 Date: Thu, 15 Dec 2022 16:54:27 +0530 Subject: [PATCH] mgr/nfs: disallow non-existent paths when creating export Fixes: https://tracker.ceph.com/issues/58228 Signed-off-by: Dhairya Parmar (cherry picked from commit 992c686a3dbff3b917885603c017ef3831143296) --- src/pybind/mgr/nfs/export.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/nfs/export.py b/src/pybind/mgr/nfs/export.py index 1e71684eedeb1..eb8452f011cc8 100644 --- a/src/pybind/mgr/nfs/export.py +++ b/src/pybind/mgr/nfs/export.py @@ -29,7 +29,7 @@ from .utils import ( conf_obj_name, available_clusters, check_fs, - restart_nfs_service) + restart_nfs_service, check_cephfs_path) if TYPE_CHECKING: from nfs.module import Module @@ -631,6 +631,9 @@ class ExportMgr: access_type: str, clients: list = [], sectype: Optional[List[str]] = None) -> Tuple[int, str, str]: + + check_cephfs_path(self.mgr, fs_name, path) + pseudo_path = normalize_path(pseudo_path) if not self._fetch_export(cluster_id, pseudo_path): -- 2.39.5