Skip to content

Commit 21d1d64

Browse files
committed
cephfs: upgrading mount syntax
The old syntax is almost deprecated,and there are reasons to upgrade it - old syntax is lack of fsid(critical for debugging and observability) - mds_namespace is deprecated, it might be inappropriate to continue using it - kernel will try new syntax first and then the old one, it's a waste Signed-off-by: mageekchiu <[email protected]>
1 parent 0cfb2b0 commit 21d1d64

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

internal/cephfs/mounter/kernel.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,13 @@ func (m *kernelMounter) mountKernel(
7474

7575
args := []string{
7676
"-t", "ceph",
77-
fmt.Sprintf("%s:%s", volOptions.Monitors, volOptions.RootPath),
77+
fmt.Sprintf("%s@%s.%s=%s", cr.ID, volOptions.ClusterID, volOptions.FsName, volOptions.RootPath),
7878
mountPoint,
7979
}
8080

81-
optionsStr := fmt.Sprintf("name=%s,secretfile=%s", cr.ID, cr.KeyFile)
82-
mdsNamespace := ""
83-
if volOptions.FsName != "" {
84-
mdsNamespace = "mds_namespace=" + volOptions.FsName
85-
}
86-
optionsStr = util.MountOptionsAdd(optionsStr, mdsNamespace, volOptions.KernelMountOptions, netDev)
81+
optionsStr := fmt.Sprintf("mon_addr=%s,secretfile=%s", strings.ReplaceAll(volOptions.Monitors, ",", "/"), cr.KeyFile)
82+
83+
optionsStr = util.MountOptionsAdd(optionsStr, volOptions.KernelMountOptions, netDev)
8784

8885
args = append(args, "-o", optionsStr)
8986

0 commit comments

Comments
 (0)