mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 20:00:23 +00:00
cephfs: make use of expand operation lock in ControllerExpandVolume
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
parent
074feddaf3
commit
66827facc3
@ -269,6 +269,13 @@ func (cs *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi
|
|||||||
}
|
}
|
||||||
defer cs.VolumeLocks.Release(volID)
|
defer cs.VolumeLocks.Release(volID)
|
||||||
|
|
||||||
|
// lock out volumeID for clone and delete operation
|
||||||
|
if err := cs.OperationLocks.GetExpandLock(volID); err != nil {
|
||||||
|
klog.Error(util.Log(ctx, err.Error()))
|
||||||
|
return nil, status.Error(codes.Aborted, err.Error())
|
||||||
|
}
|
||||||
|
defer cs.OperationLocks.ReleaseExpandLock(volID)
|
||||||
|
|
||||||
cr, err := util.NewAdminCredentials(secret)
|
cr, err := util.NewAdminCredentials(secret)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, status.Error(codes.InvalidArgument, err.Error())
|
return nil, status.Error(codes.InvalidArgument, err.Error())
|
||||||
|
Loading…
Reference in New Issue
Block a user