From 10b4bf304bd110102d52dd9c5012b6ae6ff58d97 Mon Sep 17 00:00:00 2001 From: Maximilian Geberl Date: Fri, 24 Jul 2026 13:40:17 +0200 Subject: [PATCH 01/10] Bump some apko dependencies --- cmd/stackit-csi-plugin/apko-base-image.yaml | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/stackit-csi-plugin/apko-base-image.yaml b/cmd/stackit-csi-plugin/apko-base-image.yaml index 9db9604e..08054523 100644 --- a/cmd/stackit-csi-plugin/apko-base-image.yaml +++ b/cmd/stackit-csi-plugin/apko-base-image.yaml @@ -6,20 +6,20 @@ contents: packages: - busybox # required by fsck.xfs as it is a sh script - ca-certificates - - blkid=~2.41.2 - - blockdev=~2.41.2 + - blkid=~2.41.3 + - blockdev=~2.41.3 - e2fsprogs=~1.47.3 - e2fsprogs-extra=~1.47.3 - - lsblk=~2.41.2 - - mount=~2.41.2 - - umount=~2.41.2 + - lsblk=~2.41.3 + - mount=~2.41.3 + - umount=~2.41.3 - btrfs-progs=~6.17 - - udev=~258.1 - - util-linux-misc=~2.41.2 # contains fsck - - xfsprogs=~6.17.0 - - xfsprogs-core=~6.17.0 - - xfsprogs-extra=~6.17.0 # contains xfs_io - - findmnt=~2.41.2 + - udev=~259.1 + - util-linux-misc=~2.41.3 # contains fsck + - xfsprogs=~6.18.0 + - xfsprogs-core=~6.18.0 + - xfsprogs-extra=~6.18.0 # contains xfs_io + - findmnt=~2.41.3 accounts: run-as: root From 3bdebd02c921a5f363208e33e21c2e5fee53a2b3 Mon Sep 17 00:00:00 2001 From: Niclas Schad Date: Tue, 28 Jul 2026 12:17:51 +0200 Subject: [PATCH 02/10] bump all dependencies; force xfs flags to 5.10 compatibility; check for valid fsTypes Signed-off-by: Niclas Schad --- cmd/stackit-csi-plugin/apko-base-image.yaml | 27 ++++++++++----------- pkg/csi/blockstorage/nodeserver.go | 23 +++++++++++++++++- pkg/csi/util/util.go | 5 ++++ 3 files changed, 40 insertions(+), 15 deletions(-) diff --git a/cmd/stackit-csi-plugin/apko-base-image.yaml b/cmd/stackit-csi-plugin/apko-base-image.yaml index 08054523..322bc46a 100644 --- a/cmd/stackit-csi-plugin/apko-base-image.yaml +++ b/cmd/stackit-csi-plugin/apko-base-image.yaml @@ -6,20 +6,19 @@ contents: packages: - busybox # required by fsck.xfs as it is a sh script - ca-certificates - - blkid=~2.41.3 - - blockdev=~2.41.3 - - e2fsprogs=~1.47.3 - - e2fsprogs-extra=~1.47.3 - - lsblk=~2.41.3 - - mount=~2.41.3 - - umount=~2.41.3 - - btrfs-progs=~6.17 - - udev=~259.1 - - util-linux-misc=~2.41.3 # contains fsck - - xfsprogs=~6.18.0 - - xfsprogs-core=~6.18.0 - - xfsprogs-extra=~6.18.0 # contains xfs_io - - findmnt=~2.41.3 + - blkid=~2.42.2 + - blockdev=~2.42.2 + - e2fsprogs=~1.47.4 + - e2fsprogs-extra=~1.47.4 + - lsblk=~2.42.2 + - mount=~2.42.2 + - umount=~2.42.2 + - udev=~261.2 + - util-linux-misc=~2.42.2 # contains fsck + - xfsprogs=~7.1.1 + - xfsprogs-core=~7.1.1 + - xfsprogs-extra=~7.1.1 # contains xfs_io + - findmnt=~2.42.2 accounts: run-as: root diff --git a/pkg/csi/blockstorage/nodeserver.go b/pkg/csi/blockstorage/nodeserver.go index 17501b5a..01b3db1d 100644 --- a/pkg/csi/blockstorage/nodeserver.go +++ b/pkg/csi/blockstorage/nodeserver.go @@ -39,6 +39,13 @@ import ( "github.com/stackitcloud/cloud-provider-stackit/pkg/stackit/metadata" ) +var ( + ValidFSTypes = map[string]struct{}{ + util.FSTypeExt4: {}, + util.FSTypeXfs: {}, + } +) + type nodeServer struct { Driver *Driver Mount mount.IMount @@ -205,6 +212,12 @@ func (ns *nodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol if mnt.FsType != "" { fsType = mnt.FsType } + + _, ok := ValidFSTypes[strings.ToLower(fsType)] + if !ok { + return nil, status.Errorf(codes.InvalidArgument, "NodeStageVolume: invalid fstype %s. Only supported fsTypes are xfs or ext4 (default)", fsType) + } + mountFlags := mnt.GetMountFlags() options = append(options, collectMountOptions(fsType, mountFlags)...) } @@ -260,7 +273,15 @@ func validateNodeStageVolumeRequest(req *csi.NodeStageVolumeRequest) (stagingTar // If the initial mount fails, it rescans the device and retries the mount operation. func (ns *nodeServer) formatAndMountRetry(devicePath, stagingTarget, fsType string, options []string) error { m := ns.Mount - err := m.Mounter().FormatAndMount(devicePath, stagingTarget, fsType, options) + var err error + if fsType == "xfs" { + // With newer xfsProgs version newer features are enabled by default. This forces mkfs.xfs to use flags compatible + // with the linux LTS 5.10 kernel + formatOptions := []string{"-i", "/usr/share/xfsprogs/mkfs/lts_5.10.conf"} + err = m.Mounter().FormatAndMountSensitiveWithFormatOptions(devicePath, stagingTarget, fsType, options, nil, formatOptions) + } else { + err = m.Mounter().FormatAndMount(devicePath, stagingTarget, fsType, options) + } if err != nil { klog.Infof("Initial format and mount failed: %v. Attempting rescan.", err) // Attempting rescan if the initial mount fails diff --git a/pkg/csi/util/util.go b/pkg/csi/util/util.go index f57f171b..1942232a 100644 --- a/pkg/csi/util/util.go +++ b/pkg/csi/util/util.go @@ -8,6 +8,11 @@ const ( TEBIBYTE ) +const ( + FSTypeExt4 = "ext4" + FSTypeXfs = "xfs" +) + // RoundUpSize calculates how many allocation units are needed to accommodate // a volume of given size. E.g. when user wants 1500MiB volume, while AWS EBS // allocates volumes in gibibyte-sized chunks, From c90fa52f1455a8de6aea1801b53778221232a00e Mon Sep 17 00:00:00 2001 From: Niclas Schad Date: Tue, 28 Jul 2026 12:38:05 +0200 Subject: [PATCH 03/10] use constant instead of string Signed-off-by: Niclas Schad --- pkg/csi/blockstorage/nodeserver.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/csi/blockstorage/nodeserver.go b/pkg/csi/blockstorage/nodeserver.go index 01b3db1d..f6853671 100644 --- a/pkg/csi/blockstorage/nodeserver.go +++ b/pkg/csi/blockstorage/nodeserver.go @@ -206,7 +206,7 @@ func (ns *nodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol // Volume Mount if notMnt { // set default fstype is ext4 - fsType := "ext4" + fsType := util.FSTypeExt4 var options []string if mnt := volumeCapability.GetMount(); mnt != nil { if mnt.FsType != "" { @@ -274,7 +274,7 @@ func validateNodeStageVolumeRequest(req *csi.NodeStageVolumeRequest) (stagingTar func (ns *nodeServer) formatAndMountRetry(devicePath, stagingTarget, fsType string, options []string) error { m := ns.Mount var err error - if fsType == "xfs" { + if fsType == util.FSTypeXfs { // With newer xfsProgs version newer features are enabled by default. This forces mkfs.xfs to use flags compatible // with the linux LTS 5.10 kernel formatOptions := []string{"-i", "/usr/share/xfsprogs/mkfs/lts_5.10.conf"} @@ -516,7 +516,7 @@ func collectMountOptions(fsType string, mntFlags []string) []string { // By default, xfs does not allow mounting of two volumes with the same filesystem uuid. // Force ignore this uuid to be able to mount volume + its clone / restored snapshot on the same node. - if fsType == "xfs" { + if fsType == util.FSTypeXfs { options = append(options, "nouuid") } return options From 02f58f247591efacada3f2105ea4909483508b31 Mon Sep 17 00:00:00 2001 From: Niclas Schad Date: Tue, 28 Jul 2026 14:04:29 +0200 Subject: [PATCH 04/10] specifically disable parent-pointers, and exchange Signed-off-by: Niclas Schad --- pkg/csi/blockstorage/nodeserver.go | 2 +- test/e2e/csi-plugin/block-storage.yaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/csi/blockstorage/nodeserver.go b/pkg/csi/blockstorage/nodeserver.go index f6853671..88548431 100644 --- a/pkg/csi/blockstorage/nodeserver.go +++ b/pkg/csi/blockstorage/nodeserver.go @@ -277,7 +277,7 @@ func (ns *nodeServer) formatAndMountRetry(devicePath, stagingTarget, fsType stri if fsType == util.FSTypeXfs { // With newer xfsProgs version newer features are enabled by default. This forces mkfs.xfs to use flags compatible // with the linux LTS 5.10 kernel - formatOptions := []string{"-i", "/usr/share/xfsprogs/mkfs/lts_5.10.conf"} + formatOptions := []string{"-n", "parent=0", "-i", "exchange=0"} err = m.Mounter().FormatAndMountSensitiveWithFormatOptions(devicePath, stagingTarget, fsType, options, nil, formatOptions) } else { err = m.Mounter().FormatAndMount(devicePath, stagingTarget, fsType, options) diff --git a/test/e2e/csi-plugin/block-storage.yaml b/test/e2e/csi-plugin/block-storage.yaml index 18e79095..ab55afe3 100644 --- a/test/e2e/csi-plugin/block-storage.yaml +++ b/test/e2e/csi-plugin/block-storage.yaml @@ -4,6 +4,9 @@ SnapshotClass: FromExistingClassName: "stackit" DriverInfo: Name: block-storage.csi.stackit.cloud + SupportedFsType: + ext4: {} + xfs: {} Capabilities: # whether to support RAW block mode block: true From f034bfa15f2e05df008d7fd397b2292c71306bb9 Mon Sep 17 00:00:00 2001 From: Niclas Schad Date: Tue, 28 Jul 2026 14:54:35 +0200 Subject: [PATCH 05/10] disable nrext64 support for XFS Signed-off-by: Niclas Schad --- pkg/csi/blockstorage/nodeserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/csi/blockstorage/nodeserver.go b/pkg/csi/blockstorage/nodeserver.go index 88548431..4fad9da8 100644 --- a/pkg/csi/blockstorage/nodeserver.go +++ b/pkg/csi/blockstorage/nodeserver.go @@ -277,7 +277,7 @@ func (ns *nodeServer) formatAndMountRetry(devicePath, stagingTarget, fsType stri if fsType == util.FSTypeXfs { // With newer xfsProgs version newer features are enabled by default. This forces mkfs.xfs to use flags compatible // with the linux LTS 5.10 kernel - formatOptions := []string{"-n", "parent=0", "-i", "exchange=0"} + formatOptions := []string{"-n", "parent=0", "-i", "exchange=0,nrext64=0"} err = m.Mounter().FormatAndMountSensitiveWithFormatOptions(devicePath, stagingTarget, fsType, options, nil, formatOptions) } else { err = m.Mounter().FormatAndMount(devicePath, stagingTarget, fsType, options) From 64ea7946c8705fff7238b11966bd1b23bda0bf48 Mon Sep 17 00:00:00 2001 From: Niclas Schad Date: Tue, 28 Jul 2026 15:59:41 +0200 Subject: [PATCH 06/10] re-add btrfs-progs Signed-off-by: Niclas Schad --- cmd/stackit-csi-plugin/apko-base-image.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/stackit-csi-plugin/apko-base-image.yaml b/cmd/stackit-csi-plugin/apko-base-image.yaml index 322bc46a..f61a6b7d 100644 --- a/cmd/stackit-csi-plugin/apko-base-image.yaml +++ b/cmd/stackit-csi-plugin/apko-base-image.yaml @@ -8,6 +8,7 @@ contents: - ca-certificates - blkid=~2.42.2 - blockdev=~2.42.2 + - btrfs-progs=~7.1 - e2fsprogs=~1.47.4 - e2fsprogs-extra=~1.47.4 - lsblk=~2.42.2 From f024dcad93be8546f827c15a5a2a221af016ab69 Mon Sep 17 00:00:00 2001 From: Niclas Schad Date: Tue, 28 Jul 2026 16:09:29 +0200 Subject: [PATCH 07/10] add support for experimental fs btrfs Signed-off-by: Niclas Schad --- docs/csi-driver.md | 8 ++++++++ pkg/csi/blockstorage/nodeserver.go | 5 +++-- pkg/csi/util/util.go | 5 +++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/csi-driver.md b/docs/csi-driver.md index ee448454..11c5b472 100644 --- a/docs/csi-driver.md +++ b/docs/csi-driver.md @@ -27,6 +27,14 @@ The CSI driver enables dynamic provisioning and management of persistent volumes ## Basic Usage +### Supported Filesystems + +We currently support the following file systems: + +- ext4 +- xfs +- [EXPERIMENTAL] btrfs. Use at your own risk! + ### Create a StorageClass ```YAML diff --git a/pkg/csi/blockstorage/nodeserver.go b/pkg/csi/blockstorage/nodeserver.go index 4fad9da8..5c115593 100644 --- a/pkg/csi/blockstorage/nodeserver.go +++ b/pkg/csi/blockstorage/nodeserver.go @@ -41,8 +41,9 @@ import ( var ( ValidFSTypes = map[string]struct{}{ - util.FSTypeExt4: {}, - util.FSTypeXfs: {}, + util.FSTypeExt4: {}, + util.FSTypeXfs: {}, + util.FSTypeBtrfs: {}, } ) diff --git a/pkg/csi/util/util.go b/pkg/csi/util/util.go index 1942232a..a67e2d56 100644 --- a/pkg/csi/util/util.go +++ b/pkg/csi/util/util.go @@ -9,8 +9,9 @@ const ( ) const ( - FSTypeExt4 = "ext4" - FSTypeXfs = "xfs" + FSTypeExt4 = "ext4" + FSTypeXfs = "xfs" + FSTypeBtrfs = "btrfs" ) // RoundUpSize calculates how many allocation units are needed to accommodate From 61fa89bb3b768f88e2c2b7633c44822c43d3bea1 Mon Sep 17 00:00:00 2001 From: Niclas Schad Date: Tue, 28 Jul 2026 16:58:05 +0200 Subject: [PATCH 08/10] add ext3 also Signed-off-by: Niclas Schad --- pkg/csi/blockstorage/nodeserver.go | 1 + pkg/csi/util/util.go | 1 + test/e2e/csi-plugin/block-storage.yaml | 2 ++ 3 files changed, 4 insertions(+) diff --git a/pkg/csi/blockstorage/nodeserver.go b/pkg/csi/blockstorage/nodeserver.go index 5c115593..5b3cc838 100644 --- a/pkg/csi/blockstorage/nodeserver.go +++ b/pkg/csi/blockstorage/nodeserver.go @@ -41,6 +41,7 @@ import ( var ( ValidFSTypes = map[string]struct{}{ + util.FSTypeExt3: {}, util.FSTypeExt4: {}, util.FSTypeXfs: {}, util.FSTypeBtrfs: {}, diff --git a/pkg/csi/util/util.go b/pkg/csi/util/util.go index a67e2d56..ef29d42b 100644 --- a/pkg/csi/util/util.go +++ b/pkg/csi/util/util.go @@ -9,6 +9,7 @@ const ( ) const ( + FSTypeExt3 = "ext3" FSTypeExt4 = "ext4" FSTypeXfs = "xfs" FSTypeBtrfs = "btrfs" diff --git a/test/e2e/csi-plugin/block-storage.yaml b/test/e2e/csi-plugin/block-storage.yaml index ab55afe3..14f691a2 100644 --- a/test/e2e/csi-plugin/block-storage.yaml +++ b/test/e2e/csi-plugin/block-storage.yaml @@ -7,6 +7,8 @@ DriverInfo: SupportedFsType: ext4: {} xfs: {} + btrfs: {} + ext3: {} Capabilities: # whether to support RAW block mode block: true From b9e27db1098040e33ce7881a7fc0744e542b4ea3 Mon Sep 17 00:00:00 2001 From: Niclas Schad Date: Wed, 29 Jul 2026 08:19:48 +0200 Subject: [PATCH 09/10] kubernetes doesn't have btrfs tests Signed-off-by: Niclas Schad --- test/e2e/csi-plugin/block-storage.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/test/e2e/csi-plugin/block-storage.yaml b/test/e2e/csi-plugin/block-storage.yaml index 14f691a2..ce3d082e 100644 --- a/test/e2e/csi-plugin/block-storage.yaml +++ b/test/e2e/csi-plugin/block-storage.yaml @@ -7,7 +7,6 @@ DriverInfo: SupportedFsType: ext4: {} xfs: {} - btrfs: {} ext3: {} Capabilities: # whether to support RAW block mode From 20fe664f7c5dfe99f52e9314ac197fc647fc92c3 Mon Sep 17 00:00:00 2001 From: Niclas Schad Date: Wed, 29 Jul 2026 09:39:00 +0200 Subject: [PATCH 10/10] add ext3 to docs Signed-off-by: Niclas Schad --- docs/csi-driver.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/csi-driver.md b/docs/csi-driver.md index 11c5b472..08af1586 100644 --- a/docs/csi-driver.md +++ b/docs/csi-driver.md @@ -31,7 +31,8 @@ The CSI driver enables dynamic provisioning and management of persistent volumes We currently support the following file systems: -- ext4 +- ext3 +- ext4 (default) - xfs - [EXPERIMENTAL] btrfs. Use at your own risk!