diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index 11cf2df3af..95783be500 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -1267,7 +1267,7 @@ virStorageBackendFileSystemVolResize(virConnectPtr conn ATTRIBUTE_UNUSED, if (vol->target.format == VIR_STORAGE_FILE_RAW) { return virStorageFileResize(vol->target.path, capacity, - vol->capacity, pre_allocate); + vol->allocation, pre_allocate); } else { if (pre_allocate) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index f08255ea0e..816efdae1f 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -2029,6 +2029,8 @@ storageVolResize(virStorageVolPtr obj, goto out; vol->capacity = abs_capacity; + if (flags & VIR_STORAGE_VOL_RESIZE_ALLOCATE) + vol->allocation = abs_capacity; /* Update pool metadata */ pool->def->allocation += (abs_capacity - vol->capacity);