Skip to content

Commit

Permalink
fix error when 2 pods mount same disk pvc on the same node
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhangx committed Apr 14, 2019
1 parent 05eb7bc commit eb37d28
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/azuredisk/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,14 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe
}

if !notMnt {
msg := fmt.Sprintf("target %q is not a valid mount point", target)
return nil, status.Error(codes.InvalidArgument, msg)
klog.V(2).Infof("target %q is already a valid mount point(device path: %v), skip format and mount", target, devicePath)
// todo: check who is mounted here. No error if its us
/*
1) Target Path MUST be the vol referenced by vol ID
2) VolumeCapability MUST match
3) Readonly MUST match
*/
return &csi.NodeStageVolumeResponse{}, nil
}
// Get fsType that the volume will be formatted with
fsType := getFStype(req.GetVolumeContext())
Expand Down

0 comments on commit eb37d28

Please sign in to comment.