linstor: deleteAsync fallback to volume UUID if path not set yet (#9325)

This commit is contained in:
Rene Peinthor 2024-07-04 14:05:01 +02:00 committed by GitHub
parent 121a35d666
commit eb1a0ef7f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -242,7 +242,9 @@ public class LinstorPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
case VOLUME:
{
final VolumeInfo volumeInfo = (VolumeInfo) dataObject;
final String rscName = LinstorUtil.RSC_PREFIX + volumeInfo.getPath();
// if volume creation wasn't completely done .setPath wasn't called, so we fallback to vol.getUuid()
final String volUuid = volumeInfo.getPath() != null ? volumeInfo.getPath() : volumeInfo.getUuid();
final String rscName = LinstorUtil.RSC_PREFIX + volUuid;
deleteResourceDefinition(storagePool, rscName);
long usedBytes = storagePool.getUsedBytes();