This is an automated email from the ASF dual-hosted git repository.
sureshanaparti pushed a commit to branch 4.18
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.18 by this push:
new eb1a0ef7f2b linstor: deleteAsync fallback to volume UUID if path not
set yet (#9325)
eb1a0ef7f2b is described below
commit eb1a0ef7f2b34d0ddea062d5feb6ea672f71de31
Author: Rene Peinthor <[email protected]>
AuthorDate: Thu Jul 4 14:05:01 2024 +0200
linstor: deleteAsync fallback to volume UUID if path not set yet (#9325)
---
.../storage/datastore/driver/LinstorPrimaryDataStoreDriverImpl.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/driver/LinstorPrimaryDataStoreDriverImpl.java
b/plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/driver/LinstorPrimaryDataStoreDriverImpl.java
index 8b9b768d2a4..63b6ebce3c8 100644
---
a/plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/driver/LinstorPrimaryDataStoreDriverImpl.java
+++
b/plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/driver/LinstorPrimaryDataStoreDriverImpl.java
@@ -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();