提交 3c41b3ea 编写于 作者: J John Ferlan

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 db9277a3)
上级 fe2cf738
...@@ -1879,8 +1879,12 @@ storageVolCreateXML(virStoragePoolPtr obj, ...@@ -1879,8 +1879,12 @@ storageVolCreateXML(virStoragePoolPtr obj,
} }
if (backend->refreshVol && 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; goto cleanup;
}
/* Update pool metadata */ /* Update pool metadata */
if (orig_pool_allocation == pool->def->allocation) if (orig_pool_allocation == pool->def->allocation)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册