qemu/nbd
Eric Blake a5068244b4 nbd: Don't inf-loop on early EOF
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 <mreitz@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1478551093-32757-1-git-send-email-eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-11-10 16:01:30 +01:00
..
client.c nbd: Don't inf-loop on early EOF 2016-11-10 16:01:30 +01:00
common.c nbd: Drop unused offset parameter 2016-07-20 14:11:54 +01:00
Makefile.objs nbd: Split nbd.c 2016-01-15 18:58:02 +01:00
nbd-internal.h nbd: Improve server handling of shutdown requests 2016-11-02 09:28:56 +01:00
server.c nbd: Implement NBD_CMD_WRITE_ZEROES on server 2016-11-02 09:28:56 +01:00