Set FS type from LINSTOR properties during mounts #320
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If a user restores a volume from a snapshot, the file system type of the restored volume may not match the requested FS type of the storage class. This may happen if for example the snapshot was taken from an xfs volume, but the new StorageClass is configured to provision ext4 volumes. We then would try to call "mount -t ext4" on a xfs-formatted block device, leading to a failure mode where the volume is created fine, but you cannot make use of it.
To fix this, instead of taking the FS type directly from Kubernetes, we use the existing LINSTOR FsType property to determine what fs type is actually on the volume. Only if this information is not provided (possible with very old snapshots or some other funky setups), we fall back to the information provided by Kubernetes.
One alternative would be to disallow such mixing of filesystem types completely, ensuring when a volume is restored from a snapshot that old and new volume have matching FS type in Kubernetes. This would permanently lock in some users to their initial choice of FS, so we instead chose the option that allows for gradual migration to a new StorageClass/FS.