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
as input may create
corrupted images in macOS especially for large files, and qemu-img
map may also report wrong things. This patch fixes this undesired
behaviors.
Signed-off-by: Yan-Jie Wang
---
block/file-posix.c | 59 ++
1 file changed, 59 insertions