cephfs: fix lock release in volumeDelete

currently the lock is not released which is
taken on the request name. this is causing issues
when the subvolume is requested for delete.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2020-08-18 10:22:36 +05:30 committed by mergify[bot]
parent 31c7c95fdb
commit 787ba69089

View File

@ -331,7 +331,7 @@ func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVol
if acquired := cs.VolumeLocks.TryAcquire(volOptions.RequestName); !acquired {
return nil, status.Errorf(codes.Aborted, util.VolumeOperationAlreadyExistsFmt, volOptions.RequestName)
}
defer cs.VolumeLocks.Release(string(volID))
defer cs.VolumeLocks.Release(volOptions.RequestName)
// Deleting a volume requires admin credentials
cr, err := util.NewAdminCredentials(secrets)