[libvirt] PATCH: Fix crash after deleting storage vol fails

After a little debugging on IRC we discovered a problem in the deletion of storage volumes. We were mistakenly calling virStorageVolFree(vol) even if the delete call failed. So the pool got left with a NULL storage volume, and later use of that pool could crash on this. Daniel Index: src/storage_driver.c =================================================================== RCS file: /data/cvs/libvirt/src/storage_driver.c,v retrieving revision 1.32 diff -u -p -r1.32 storage_driver.c --- src/storage_driver.c 5 Feb 2009 16:28:30 -0000 1.32 +++ src/storage_driver.c 6 Mar 2009 12:56:20 -0000 @@ -1296,7 +1296,6 @@ storageVolumeDelete(virStorageVolPtr obj ret = 0; cleanup: - virStorageVolDefFree(vol); if (pool) virStoragePoolObjUnlock(pool); return ret; -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Fri, Mar 06, 2009 at 12:58:07PM +0000, Daniel P. Berrange wrote:
After a little debugging on IRC we discovered a problem in the deletion of storage volumes. We were mistakenly calling virStorageVolFree(vol) even if the delete call failed. So the pool got left with a NULL storage volume, and later use of that pool could crash on this.
ACK, a kind of bug that unfortunatley are hard to find unless someone hits the problem and reports it, thanks to him ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

Daniel Veillard:
On Fri, Mar 06, 2009 at 12:58:07PM +0000, Daniel P. Berrange wrote:
After a little debugging on IRC we discovered a problem in the deletion of storage volumes. ACK, a kind of bug that unfortunatley are hard to find unless someone hits the problem and reports it, thanks to him !
Thanks for taking the time to work with me on that! I only exposed it myself when I fattened up a test machine with enough RAM that I was creating and destroying 6 or 7 small VMs at a time. I never encountered it when I was limited to 3 guest domains. -- "No, I ain't got a fax machine! I also ain't got an Nick Moffitt Apple IIc, polio, or a falcon!" nick@zork.net -- Ray, Achewood 2006-11-22
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Nick Moffitt