From 21d1d640e2591e063781674006e39e4137247dbf Mon Sep 17 00:00:00 2001 From: mageekchiu Date: Sat, 18 Jan 2025 02:34:17 +0800 Subject: [PATCH] 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 --- internal/cephfs/mounter/kernel.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/internal/cephfs/mounter/kernel.go b/internal/cephfs/mounter/kernel.go index 09bc707f5b8..192e880c0a8 100644 --- a/internal/cephfs/mounter/kernel.go +++ b/internal/cephfs/mounter/kernel.go @@ -74,16 +74,13 @@ func (m *kernelMounter) mountKernel( args := []string{ "-t", "ceph", - fmt.Sprintf("%s:%s", volOptions.Monitors, volOptions.RootPath), + fmt.Sprintf("%s@%s.%s=%s", cr.ID, volOptions.ClusterID, volOptions.FsName, volOptions.RootPath), mountPoint, } - optionsStr := fmt.Sprintf("name=%s,secretfile=%s", cr.ID, cr.KeyFile) - mdsNamespace := "" - if volOptions.FsName != "" { - mdsNamespace = "mds_namespace=" + volOptions.FsName - } - optionsStr = util.MountOptionsAdd(optionsStr, mdsNamespace, volOptions.KernelMountOptions, netDev) + optionsStr := fmt.Sprintf("mon_addr=%s,secretfile=%s", strings.ReplaceAll(volOptions.Monitors, ",", "/"), cr.KeyFile) + + optionsStr = util.MountOptionsAdd(optionsStr, volOptions.KernelMountOptions, netDev) args = append(args, "-o", optionsStr)