mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-10 00:10:20 +00:00
cephfs: 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 <hchiramm@redhat.com>
This commit is contained in:
parent
ef852cc93d
commit
ced3a0922f
@ -267,16 +267,9 @@ func (ns *NodeServer) NodeUnpublishVolume(
|
|||||||
if err = util.ValidateNodeUnpublishVolumeRequest(req); err != nil {
|
if err = util.ValidateNodeUnpublishVolumeRequest(req); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
// considering kubelet make sure node operations like unpublish/unstage...etc can not be called
|
||||||
volID := req.GetVolumeId()
|
// at same time, an explicit locking at time of nodeunpublish is not required.
|
||||||
targetPath := req.GetTargetPath()
|
targetPath := req.GetTargetPath()
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
isMnt, err := util.IsMountPoint(targetPath)
|
isMnt, err := util.IsMountPoint(targetPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user