From ef852cc93d1fb75e59f0e252dbc7634c2ce03d4c Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Tue, 13 Jul 2021 10:51:56 +0530 Subject: [PATCH] rbd: Get rid of locking at nodeUnpublish call Considering kubelet make sure the unstage and unpublish operations are serialized, we dont need any extra locking in nodeUnpublish Signed-off-by: Humble Chirammal --- internal/rbd/nodeserver.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/internal/rbd/nodeserver.go b/internal/rbd/nodeserver.go index b1eae7245..5549616c5 100644 --- a/internal/rbd/nodeserver.go +++ b/internal/rbd/nodeserver.go @@ -611,14 +611,8 @@ func (ns *NodeServer) NodeUnpublishVolume( } targetPath := req.GetTargetPath() - volID := req.GetVolumeId() - - 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 node operations like unpublish/unstage...etc can not be called + // at same time, an explicit locking at time of nodeunpublish is not required. notMnt, err := mount.IsNotMountPoint(ns.mounter, targetPath) if err != nil { if os.IsNotExist(err) {