]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/nfs: disallow non-existent paths when creating export
authordparmar18 <dparmar@redhat.com>
Thu, 15 Dec 2022 11:24:27 +0000 (16:54 +0530)
committerDhairya Parmar <dparmar@redhat.com>
Fri, 31 Mar 2023 08:19:16 +0000 (13:49 +0530)
Fixes: https://tracker.ceph.com/issues/58228
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
(cherry picked from commit 992c686a3dbff3b917885603c017ef3831143296)

src/pybind/mgr/nfs/export.py

index 1e71684eedeb1ceebfeeeab4089532ff93c44dba..eb8452f011cc871a67f20af682ee963c961f8e11 100644 (file)
@@ -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):