qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] nbd: Don't inf-loop on early EOF


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH] nbd: Don't inf-loop on early EOF
Date: Mon, 7 Nov 2016 23:22:40 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

On 07.11.2016 21:38, Eric Blake wrote:
> Commit 7d3123e converted a single read_sync() into a while loop
> that assumed that read_sync() would either make progress or give
> an error. But when the server hangs up early, the client sees
> EOF (a read_sync() of 0) and never makes progress, which in turn
> caused qemu-iotest './check -nbd 83' to go into an infinite loop.
> 
> Rework the loop to accomodate reads cut short by EOF.
> 
> Reported-by: Max Reitz <address@hidden>
> Signed-off-by: Eric Blake <address@hidden>
> ---
>  nbd/client.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)

Reviewed-by: Max Reitz <address@hidden>

But what about the server's nbd_negotiate_drop_sync()? It uses pretty
much the same code, so it seems susceptible to the same issue (only that
we don't have a test for that side).

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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