From a0c8d015f63de36ae5a3e54ff6654a340022acba Mon Sep 17 00:00:00 2001 From: haruband Date: Wed, 5 Apr 2023 12:42:54 +0900 Subject: [PATCH] fix: make ro and rw mounts for one same nqn possible in a single node ReadOnly and ReadWrite mounts for one same nqn in a single node return -EBUSY error. So, we should remove readonly and readwrite options when mounting a block device in a csi driver. A cri runtime makes a mount as readonly inside containers if needed. --- pkg/nvmf/nvmf.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkg/nvmf/nvmf.go b/pkg/nvmf/nvmf.go index 0fb68d4..491f7db 100644 --- a/pkg/nvmf/nvmf.go +++ b/pkg/nvmf/nvmf.go @@ -142,11 +142,6 @@ func AttachDisk(req *csi.NodePublishVolumeRequest, nm nvmfDiskMounter) (string, // Tips: use k8s mounter to mount fs and only support "ext4" var options []string - if nm.readOnly { - options = append(options, "ro") - } else { - options = append(options, "rw") - } options = append(options, nm.mountOptions...) err = nm.mounter.FormatAndMount(devicePath, mntPath, nm.fsType, options) if err != nil {