bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Bug 1776920] Re: qemu-img convert on Mac OSX creates c


From: Eric Blake
Subject: Re: [Qemu-devel] [Bug 1776920] Re: qemu-img convert on Mac OSX creates corrupt images
Date: Fri, 7 Sep 2018 15:17:02 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

[redirecting to gnulib]

On 09/07/2018 01:04 PM, Yan-Jie Wang wrote:
I have done some experiments and find out that
the behavior of lseek with whence set to SEEK_DATA is different from the 
behavior of Linux's lseek.

If the supplied offset is in the middle of a data region, it returns the
start of the next data region.  There may be many data regions in a big
file even though it has no hole.

return value of lseek with whence set to SEEK_DATA:

|--(offset)--Data----|(return value)----Data----|
|--(offset)--Data----|----Hole----|(return value)----Data----|

Ouch. That's a nasty bug in MacOS, and gnulib should be taught to work around broken lseek(SEEK_DATA) (qemu doesn't use gnulib, but this bug is nasty enough that I'm worried about what other gnulib clients may also encounter the problem).

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]