Skip to content

Commit

Permalink
cephfs: upgrading mount syntax
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
MageekChiu committed Jan 21, 2025
1 parent 0cfb2b0 commit 21d1d64
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions internal/cephfs/mounter/kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 21d1d64

Please sign in to comment.