cephfs: return correct error msg

return SnapshotOperationAlreadyExistsFmt instead of
VolumeOperationAlreadyExistsFmt incase of delete snapshot
operation.

Signed-off-by: yati1998 <ypadia@redhat.com>
This commit is contained in:
yati padia 2024-09-23 16:59:37 +05:30 committed by mergify[bot]
parent 1edceebffa
commit 29aecd345f

View File

@ -1067,7 +1067,7 @@ func (cs *ControllerServer) DeleteSnapshot(
if acquired := cs.SnapshotLocks.TryAcquire(sid.RequestName); !acquired { if acquired := cs.SnapshotLocks.TryAcquire(sid.RequestName); !acquired {
log.ErrorLog(ctx, util.SnapshotOperationAlreadyExistsFmt, sid.RequestName) log.ErrorLog(ctx, util.SnapshotOperationAlreadyExistsFmt, sid.RequestName)
return nil, status.Errorf(codes.Aborted, util.VolumeOperationAlreadyExistsFmt, sid.RequestName) return nil, status.Errorf(codes.Aborted, util.SnapshotOperationAlreadyExistsFmt, sid.RequestName)
} }
defer cs.SnapshotLocks.Release(sid.RequestName) defer cs.SnapshotLocks.Release(sid.RequestName)