Skip to content

Support mkfsOptions in StorageClass parameters for ext4/xfs formatting? #272

Description

@Fan123-ui

What happened?

When creating a PersistentVolumeClaim (PVC) with a StorageClass that specifies mkfsOptions, the open-local CSI driver does not pass these options to the mkfs command during volume formatting.

For example, with the following StorageClass:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: local-ext4-casefold
provisioner: local.csi.aliyun.com
parameters:
  mkfsOptions: "-O casefold -E nodiscard"

The actual mkfs.ext4 command executed by the CSI plugin is:
mkfs.ext4 -F -m0 /dev/open-local-pool-0/volume-xxx

The expected command should include the user-provided options:
mkfs.ext4 -F -m0 -O casefold -E nodiscard /dev/open-local-pool-0/volume-xxx
This prevents users from enabling critical ext4 features like casefold or disabling discard for performance reasons.Does the StorageClass of Open-Local support the mkfsOptions parameter? If not, why not?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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