mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 11:00:25 +00:00
cephfs: Get rid of locking at nodepublish
Considering kubelet make sure the stage and publish operations are serialized, we dont need any extra locking in nodePublish Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
parent
61bf49a4f5
commit
e088e8fd2e
@ -217,11 +217,8 @@ func (ns *NodeServer) NodePublishVolume(
|
|||||||
targetPath := req.GetTargetPath()
|
targetPath := req.GetTargetPath()
|
||||||
volID := req.GetVolumeId()
|
volID := req.GetVolumeId()
|
||||||
|
|
||||||
if acquired := ns.VolumeLocks.TryAcquire(volID); !acquired {
|
// Considering kubelet make sure the stage and publish operations
|
||||||
util.ErrorLog(ctx, util.VolumeOperationAlreadyExistsFmt, volID)
|
// are serialized, we dont need any extra locking in nodePublish
|
||||||
return nil, status.Errorf(codes.Aborted, util.VolumeOperationAlreadyExistsFmt, volID)
|
|
||||||
}
|
|
||||||
defer ns.VolumeLocks.Release(volID)
|
|
||||||
|
|
||||||
if err := util.CreateMountPoint(targetPath); err != nil {
|
if err := util.CreateMountPoint(targetPath); err != nil {
|
||||||
util.ErrorLog(ctx, "failed to create mount point at %s: %v", targetPath, err)
|
util.ErrorLog(ctx, "failed to create mount point at %s: %v", targetPath, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user