From caf56a2ddfc83139b3711b9bdb5fb077ff056567 Mon Sep 17 00:00:00 2001 From: Connor Catlett Date: Mon, 6 Mar 2023 17:23:32 +0000 Subject: [PATCH] Add support for XFS custom block sizes XFS requires "size=" prepended to the size passsed to -b for mkfs.xfs Signed-off-by: Connor Catlett --- pkg/driver/node.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/driver/node.go b/pkg/driver/node.go index 9ed7ff7999..3afff717ca 100644 --- a/pkg/driver/node.go +++ b/pkg/driver/node.go @@ -229,6 +229,9 @@ func (d *nodeService) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol klog.V(4).InfoS("NodeStageVolume: formatting and mounting with fstype", "source", source, "target", target, "fstype", fsType) formatOptions := []string{} if len(blockSize) > 0 { + if fsType == FSTypeXfs { + blockSize = "size=" + blockSize + } formatOptions = append(formatOptions, "-b", blockSize) } err = d.mounter.FormatAndMountSensitiveWithFormatOptions(source, target, fsType, mountOptions, nil, formatOptions)