On 11/04/2016 05:02 PM, Max Reitz wrote: >> nbd: Let client skip portions of server reply > > This patch (7d3123e1775) breaks iotest 083 (it hangs somewhere).
Adding this breaks the infinite loop: diff --git i/nbd/client.c w/nbd/client.c index 5d94e34..23ad4f1 100644 --- i/nbd/client.c +++ w/nbd/client.c @@ -87,10 +87,11 @@ static ssize_t drop_sync(QIOChannel *ioc, size_t size) while (size > 0) { ret = read_sync(ioc, buffer, MIN(65536, size)); if (ret < 0) { goto cleanup; } + assert(ret); assert(ret <= size); size -= ret; } ret = dropped; but then fails the assertion, which means read_sync() is returning 0 in our particular test (which sort of makes sense: the test is purposefully truncating the server stream at various points to see how the client reacts). I'm trying to figure out if always treating early EOF as a read error would be sufficient to make things work the way we want in the client. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature