Project

General

Profile

Bug #62077

mgr/nfs: validate path when modifying cephfs export

Added by Dhairya Parmar 7 months ago. Updated 7 months ago.

Status:
In Progress
Priority:
Normal
Category:
Administration/Usability
Target version:
% Done:

0%

Source:
Development
Tags:
Backport:
reef,quincy,pacific
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
mgr/nfs
Labels (FS):
NFS-cluster
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

sh-4.4$ ceph nfs export ls nfs-cephfs --detailed
[
  {
    "export_id": 1,
    "path": "/",
    "cluster_id": "nfs-cephfs",
    "pseudo": "/ceph",
    "access_type": "RW",
    "squash": "none",
    "security_label": true,
    "protocols": [
      4
    ],
    "transports": [
      "TCP" 
    ],
    "fsal": {
      "name": "CEPH",
      "user_id": "nfs.nfs-cephfs.1",
      "fs_name": "myfs" 
    },
    "clients": []
  }
]
sh-4.4$ cat export.conf 
{ 
 "export_id": 1,
  "path": "/non_existent_path",
  "cluster_id": "cephfsnfs",
  "pseudo": "/ceph",
  "access_type": "RW",
  "squash": "none",
  "security_label": true,
  "protocols": [
    4
  ],
  "transports": [
    "TCP" 
  ],
  "fsal": {
    "name": "CEPH",
    "user_id": "nfs.nfs-cephfs.1",
    "fs_name": "myfs" 
  },
  "clients": []
}
sh-4.4$ ceph nfs export apply nfs-cephfs -i export.conf
sh-4.4$ ceph nfs export ls nfs-cephfs --detailed
[
  {
    "export_id": 1,
    "path": "/non_existent_path",
    "cluster_id": "nfs-cephfs",
    "pseudo": "/ceph",
    "access_type": "RW",
    "squash": "none",
    "security_label": true,
    "protocols": [
      4
    ],
    "transports": [
      "TCP" 
    ],
    "fsal": {
      "name": "CEPH",
      "user_id": "nfs.nfs-cephfs.1",
      "fs_name": "myfs" 
    },
    "clients": []
  }
]

Mounting this export would most probably fail. Therefore check if the path is valid.

History

#1 Updated by Venky Shankar 7 months ago

  • Category set to Administration/Usability
  • Assignee set to Dhairya Parmar
  • Target version set to v19.0.0
  • Backport set to reef,quincy,pacific

Dhairya, this should be straightforward with the path validation helper you introduced, right?

#2 Updated by Dhairya Parmar 7 months ago

Venky Shankar wrote:

Dhairya, this should be straightforward with the path validation helper you introduced, right?

yes

#3 Updated by Dhairya Parmar 7 months ago

  • Status changed from New to In Progress
  • Pull request ID set to 52859

Also available in: Atom PDF