On 09/22/2014 09:36 AM, Max Reitz wrote: > As its comment states, raw_co_get_block_status() should unconditionally > return 0 and set *pnum to 0 for after EOF. > > An assertion after lseek(..., SEEK_HOLE) tried to catch this case by > asserting that errno != -ENXIO (which would indicate a position after > the EOF); but it should be errno != ENXIO instead. Fix this, too. > > Additionally, nb_sectors should be clamped against the image end. This > was probably not an issue if FIEMAP or SEEK_HOLE/SEEK_DATA worked, but > the fallback did not take this case into account. > > Reported-by: Kevin Wolf <kw...@redhat.com> > Signed-off-by: Max Reitz <mre...@redhat.com> > --- > block/raw-posix.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) >
Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature