mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
storage: Handle failure from refreshVol
Commit id '155ca616' added the 'refreshVol' API. In an NFS root-squash environment it was possible that if the just created volume from XML wasn't properly created with the right uid/gid and/or mode, then the followup refreshVol will fail to open the volume in order to get the allocation/ capacity values. This would leave the volume still on the server and cause a libvirtd crash because 'voldef' would be in the pool list, but the cleanup code would free it. (cherry picked from commit db9277a39bc364806e8d3e08a08fc128d59b7094)
This commit is contained in:
parent
fe2cf73800
commit
3c41b3ea5e
@ -1879,8 +1879,12 @@ storageVolCreateXML(virStoragePoolPtr obj,
|
||||
}
|
||||
|
||||
if (backend->refreshVol &&
|
||||
backend->refreshVol(obj->conn, pool, voldef) < 0)
|
||||
backend->refreshVol(obj->conn, pool, voldef) < 0) {
|
||||
storageVolDeleteInternal(volobj, backend, pool, voldef,
|
||||
0, false);
|
||||
voldef = NULL;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Update pool metadata */
|
||||
if (orig_pool_allocation == pool->def->allocation)
|
||||
|
Loading…
x
Reference in New Issue
Block a user