Skip to content

Commit

Permalink
add linux 5.4 kernel support for xfs
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandr Stefurishin <alexandr.stefurishin@flant.com>
  • Loading branch information
Alexandr Stefurishin committed Sep 17, 2024
1 parent 8120e3c commit 0891054
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions images/sds-local-volume-csi/driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})

Expand Down Expand Up @@ -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
}

0 comments on commit 0891054

Please sign in to comment.