From 61bf49a4f5594c087941d5093cb42416aa96116f Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Tue, 13 Jul 2021 10:57:20 +0530 Subject: [PATCH] rbd: 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 --- internal/rbd/nodeserver.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/internal/rbd/nodeserver.go b/internal/rbd/nodeserver.go index 5549616c5..9bb944320 100644 --- a/internal/rbd/nodeserver.go +++ b/internal/rbd/nodeserver.go @@ -439,11 +439,8 @@ func (ns *NodeServer) NodePublishVolume( volID := req.GetVolumeId() stagingPath += "/" + volID - if acquired := ns.VolumeLocks.TryAcquire(volID); !acquired { - util.ErrorLog(ctx, util.VolumeOperationAlreadyExistsFmt, volID) - return nil, status.Errorf(codes.Aborted, util.VolumeOperationAlreadyExistsFmt, volID) - } - defer ns.VolumeLocks.Release(volID) + // Considering kubelet make sure the stage and publish operations + // are serialized, we dont need any extra locking in nodePublish // Check if that target path exists properly notMnt, err := ns.createTargetMountPath(ctx, targetPath, isBlock)