qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 3/4] raw-posix: Fix try_seek_hole()'s handlin


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v2 3/4] raw-posix: Fix try_seek_hole()'s handling of SEEK_DATA failure
Date: Thu, 13 Nov 2014 11:22:26 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

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 <address@hidden>
---
  block/raw-posix.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Max Reitz <address@hidden>



reply via email to

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