[libvirt] [PATCH 09/12] storage: Cleanup failures in virStorageBackendCreateRaw
pkrempa at redhat.com
Wed Oct 14 13:45:45 UTC 2015
On Wed, Oct 14, 2015 at 09:35:24 -0400, John Ferlan wrote:
> On 10/14/2015 08:16 AM, Peter Krempa wrote:
> > On Tue, Oct 13, 2015 at 16:12:46 -0400, John Ferlan wrote:
> > Erm, you've patched virFileOpenAs a few patches before this to do the
> > right thing when creating the file so I don't see a reason to make sure
> > again.
> I know that, look closer at the code after the call to virFileOpenAs. We
> know that if virOpenFileAs succeeds then we've created the file (if it
> didn't exist prior to calling virOpenFileAs); however, if the following
> if ((ret = createRawFile(fd, vol, inputvol, reflink_copy)) < 0)
> /* createRawFile already reported the exact error. */
> ret = -1;
> we would have left the function creating the file, but not deleting it
> because some subsequent action failed.
I agree that virStorageBackendCreateRaw needs to delete the file in some
cases. I just don't think that checking if the file exists prior to the
call to virOpenFileAs is necessary or makes sense in any way.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: Digital signature
More information about the libvir-list