diff --git a/internal/rbd/nodeserver.go b/internal/rbd/nodeserver.go index 906f2986f13a..a32a817e4415 100644 --- a/internal/rbd/nodeserver.go +++ b/internal/rbd/nodeserver.go @@ -366,7 +366,6 @@ func (ns *NodeServer) stageTransaction( transaction := &stageTransaction{} var err error - var readOnly bool // Allow image to be mounted on multiple nodes if it is ROX if req.VolumeCapability.AccessMode.Mode == csi.VolumeCapability_AccessMode_MULTI_NODE_READER_ONLY { @@ -421,7 +420,7 @@ func (ns *NodeServer) stageTransaction( transaction.isStagePathCreated = true // nodeStage Path - readOnly, err = ns.mountVolumeToStagePath(ctx, req, staticVol, stagingTargetPath, devicePath) + _, err = ns.mountVolumeToStagePath(ctx, req, staticVol, stagingTargetPath, devicePath) if err != nil { return transaction, err } @@ -436,11 +435,6 @@ func (ns *NodeServer) stageTransaction( return transaction, err } - if !readOnly { - // #nosec - allow anyone to write inside the target path - err = os.Chmod(stagingTargetPath, 0o777) - } - return transaction, err }