Skip to content

chmodIfPermissionMismatch resets the gid bits of the nfs target path #2607

Closed
@nearora-msft

Description

@nearora-msft

What happened:
When volumeAttributes.mountPermissions are set in an NFS PV, we run chmod. The go implementation of os.chmod is such that sometimes it ends up resetting the gid bits. For example, if the mountPermissions are set to "02775" and the NFS target path already has the gid mode bits set, the mode bits from go's perspective change from “20020000775” to “20000000775”.

This causes the CSI driver to unnecessarily apply the SetVolumeOwnership changes later, which takes up quite a lot of time.

What you expected to happen:
The gid bits shouldn't be reset.

How to reproduce it:

Anything else we need to know?:

Environment:

  • CSI Driver version:
  • Kubernetes version (use kubectl version):
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions