-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cephfs: upgrading mount syntax #5090
base: devel
Are you sure you want to change the base?
Conversation
Many thanks @MageekChiu! Could you update the PR description with a reference that explains the changes? It would be useful to know how recent these changes are, and if there could be a problem when users have an older version deployed. It seems the commit message contains a few long lines. Please edit it and keep them under 80 characters. @kotreshhr, maybe you have a reference to the new/changed mount options handy? |
19eeb9a
to
21d1d64
Compare
@nixpanic Greate advices, thank you. Cool homepage by the way, need to add one myself 😄. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
Pull request has been modified.
63c4692
to
42b818b
Compare
I see the old and new mount options are already linked in the PR. Yes, the kernel tries the new syntax first and falls back to old if not available. I think this should be fine but tagging the kernel developer @Markuze @vshankar to confirm if this breaks anything based on the version it got introduced. |
@@ -46,6 +46,7 @@ type VolumeOptions struct { | |||
RequestName string | |||
NamePrefix string | |||
ClusterID string | |||
FsID string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of always fetching the FsID
, can you add a func (vo *VolumeOptions) GetFSID() (string, error)
function?
This can then be used where needed, currently only in NewKernelMounter()
.
By extending the NewVolumeOptions()
function, it grows (too) large, and the golang-ci linter fails due to that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nixpanic,I believe you may have missed this—we already have GetFSID()
defined in the ClusterConnection
struct. Since ClusterConnection
is a member of the VolumeOptions
struct, it can be accessed via vo.conn.GetFSID()
.
Hi @MageekChiu, the PR looks good to me. Can you squash all commits into a single one and force-push your branch? That makes it possible for the @mergify bot can do it's work and get this in soon. Thanks! |
@@ -72,24 +72,25 @@ func (m *kernelMounter) mountKernel( | |||
m.needsModprobe = false | |||
} | |||
|
|||
fsID, err := volOptions.GetFSID() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why can't we use existing GetFSID()
instead?
fsID, err := volOptions.GetFSID() | |
fsID, err := volOptions.GetConnection().GetFSID() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
volOptions.GetConnection()
can return nil
, so it is not really safe. A new GetFSID()
would prevent any incorrect usage, now, and possibly in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think the checking is needed, Connect
and Destroy
do the checking too.
And I've squashed the commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
volOptions.GetConnection() can return nil, so it is not really safe. A new GetFSID() would prevent any incorrect usage, now, and possibly in the future.
when volOptions struct is created, we make sure we have the connection set. There is no way GetConnection()
could return nil.
IMO, GetConnection()
should be handling the nil check, or the GetConnection()
caller should check for nil and proceed.
as we have similar usage at some places. for example -
ceph-csi/internal/cephfs/nodeserver.go
Lines 145 to 153 in 72b9d5a
ioctx, err := volOptions.GetConnection().GetIoctx(volOptions.MetadataPool) | |
if err != nil { | |
log.ErrorLog(ctx, "Failed to create ioctx: %s", err) | |
return err | |
} | |
defer ioctx.Destroy() | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, improving GetConnection()
would be nice too. I don't think that needs to be done in this PR though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, improving
GetConnection()
would be nice too. I don't think that needs to be done in this PR though.
That can be done through issue #5129.
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]>
/test ci/centos/mini-e2e/k8s-1.32 |
There has been a new Ceph release yesterday, building Ceph-CSI fails until the new container-image can install required RPMs (librados-devel etc...). 😢 |
The old syntax is almost deprecated, and there are reasons to upgrade it to the new one
From the ubuntu manpage,20.04 LTS supports the old syntax while 22.04 LTS supports the new one.