Skip to content
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

Add support for XFS custom block sizes #1523

Merged
merged 1 commit into from
Mar 9, 2023

Conversation

ConnorJC3
Copy link
Contributor

XFS requires "size=" prepended to the size passsed to -b for mkfs.xfs

@k8s-ci-robot k8s-ci-robot requested review from rdpsin and torredil March 6, 2023 17:25
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 6, 2023
XFS requires "size=" prepended to the size passsed to -b for mkfs.xfs

Signed-off-by: Connor Catlett <[email protected]>
@torredil
Copy link
Member

torredil commented Mar 6, 2023

SC:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ebs-sc
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer
parameters:
  blocksize: "4096"
  csi.storage.k8s.io/fstype: xfs

Without this change:

  Warning  FailedMount             10s (x7 over 42s)  kubelet                  MountVolume.MountDevice failed for volume "pvc-e810709a-cdc4-4f9a-857f-c2f952176f40" : rpc error: code = Internal desc = could not format "/dev/nvme1n1" and mount it at "/var/lib/kubelet/plugins/kubernetes.io/csi/ebs.csi.aws.com/662d547f3795c6f2ff978110909cf16c03480fc9a2420e9f496bff7487ae3a48/globalmount": format of disk "/dev/nvme1n1" failed: type:("xfs") target:("/var/lib/kubelet/plugins/kubernetes.io/csi/ebs.csi.aws.com/662d547f3795c6f2ff978110909cf16c03480fc9a2420e9f496bff7487ae3a48/globalmount") options:("nouuid,defaults") errcode:(exit status 1) output:(unknown option -b 3535
Usage: mkfs.xfs
/* blocksize */          [-b size=num]
/* metadata */           [-m crc=0|1,finobt=0|1,uuid=xxx,rmapbt=0|1,reflink=0|1,
                               inobtcount=0|1,bigtime=0|1]
/* data subvol */      [-d agcount=n,agsize=n,file,name=xxx,size=num,
                               (sunit=value,swidth=value|su=num,sw=num|noalign),
                               sectsize=num
/* force overwrite */  [-f]
/* inode size */       [-i log=n|perblock=n|size=num,maxpct=n,attr=0|1|2,
                               projid32bit=0|1,sparse=0|1]
/* no discard */       [-K]
/* log subvol */       [-l agnum=n,internal,size=num,logdev=xxx,version=n
                               sunit=value|su=num,sectsize=num,lazy-count=0|1]
/* label */              [-L label (maximum 12 characters)]
/* naming */             [-n size=num,version=2|ci,ftype=0|1]
/* no-op info only */  [-N]
/* prototype file */   [-p fname]
/* quiet */              [-q]
/* realtime subvol */  [-r extsize=num,size=num,rtdev=xxx]
/* sectorsize */       [-s size=num]
/* version */            [-V]
                           devicename
<devicename> is required unless -d name=xxx is given.
<num> is xxx (bytes), xxxs (sectors), xxxb (fs blocks), xxxk (xxx KiB),
      xxxm (xxx MiB), xxxg (xxx GiB), xxxt (xxx TiB) or xxxp (xxx PiB).
<value> is xxx (512 byte blocks).
)

With this change:

Normal   Started                 0s    kubelet                  Started container app

$ kubectl exec --stdin --tty app -- /bin/bash

$ root@app:/# stat -f /data
  File: "/data"
    ID: 1030300000000 Namelen: 255     Type: xfs
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 1046016    Free: 1030435    Available: 1030435
Inodes: Total: 2097152    Free: 2097148

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 6, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: torredil, wmesard

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 9, 2023
@k8s-ci-robot k8s-ci-robot merged commit 29a19d2 into kubernetes-sigs:master Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants