Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable uuid checks on XFS #955

Merged
merged 1 commit into from
Jul 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion pkg/azuredisk/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe
if mnt.FsType != "" {
fstype = mnt.FsType
}
options = append(options, mnt.MountFlags...)
options = append(options, collectMountOptions(fstype, mnt.MountFlags)...)
}

volContextFSType := getFStype(req.GetVolumeContext())
Expand Down Expand Up @@ -600,3 +600,15 @@ func (d *Driver) ensureBlockTargetFile(target string) error {

return nil
}

func collectMountOptions(fsType string, mntFlags []string) []string {
var options []string
options = append(options, mntFlags...)

// 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" {
options = append(options, "nouuid")
}
return options
}