From 0891054dbd089ff7fa7cc09596fbacf1d68cd822 Mon Sep 17 00:00:00 2001 From: Alexandr Stefurishin Date: Wed, 18 Sep 2024 00:21:51 +0300 Subject: [PATCH] add linux 5.4 kernel support for xfs Signed-off-by: Alexandr Stefurishin --- images/sds-local-volume-csi/driver/node.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/images/sds-local-volume-csi/driver/node.go b/images/sds-local-volume-csi/driver/node.go index 996484a7..d8a22e22 100644 --- a/images/sds-local-volume-csi/driver/node.go +++ b/images/sds-local-volume-csi/driver/node.go @@ -149,10 +149,11 @@ func (d *Driver) NodeStageVolume(_ context.Context, request *csi.NodeStageVolume if len(ext4ClusterSize) > 0 { formatOptions = append(formatOptions, "-C", ext4ClusterSize) } - // TODO support linux kernel ≤ v5.4 - // if fsType == internal.FSTypeXfs && d.options.LegacyXFSProgs { - // formatOptions = append(formatOptions, "-m", "bigtime=0,inobtcount=0,reflink=0") - // } + // support mounting on linux kernel ≤ v5.4 + if fsType == internal.FSTypeXfs && needLegacyXfsSupport() { + d.log.Info("[NodeStageVolume] Linux <= 5.4 detected, LegacyXfsSupport is on") + formatOptions = append(formatOptions, "-m", "bigtime=0,inobtcount=0,reflink=0") + } mountOptions := collectMountOptions(fsType, mountVolume.GetMountFlags(), []string{}) @@ -467,3 +468,14 @@ func recheckFormattingOptionParameter(context map[string]string, key string, fsC } return v, nil } + +func needLegacyXfsSupport() bool { + // TODO DO NOT MERGE + // TODO DO NOT MERGE + // TODO DO NOT MERGE + // TODO DO NOT MERGE + // TODO DO NOT MERGE + // TODO DO NOT MERGE + // TODO DO NOT MERGE + return true +}