On 2014-11-13 at 11:17, Markus Armbruster wrote:
When SEEK_HOLE tells us we're in a hole, we try SEEK_DATA to find its
end.  When that fails, we pretend the hole extends to the end of file.
Wrong.  Except when SEEK_END fails, we screw up and claim it extends
to offset -1.  More wrong.

Fortunately, these seeks are very unlikely to fail.  Fix it anyway, by
returning failure.  The caller will then pretend there are no holes.
Inaccurate, but safe.

Signed-off-by: Markus Armbruster <arm...@redhat.com>
---
  block/raw-posix.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Max Reitz <mre...@redhat.com>

Reply via email to