Re: [Nbd] Bug with large reads and protocol issue
- To: Alex Bligh <alex@...872...>
- Cc: nbd-general@lists.sourceforge.net
- Subject: Re: [Nbd] Bug with large reads and protocol issue
- From: Paul Clements <paul.clements@...856...>
- Date: Fri, 3 Jun 2011 12:08:40 -0400
- Message-id: <BANLkTi=vFZ_UV_b-hTeBmhrzyWOEVw=_fg@...18...>
- In-reply-to: <1A3272F13ED09C17872AE433@...874...>
- References: <9C86247514F89CE6A7B95C36@...908...> <87wrh35gph.fsf@...860...> <1A3272F13ED09C17872AE433@...874...>
On Fri, Jun 3, 2011 at 11:43 AM, Alex Bligh <alex@...872...> wrote:
>> That scheme would mean the client would have to buffer the complete read
>> in memory and couldn't streamline it to the application as it comes
>> in. For an exterem example an NBD proxy/gateway could normaly just pipe
>> the data through. But now it would have to buffer large requests.
>
> The bio is already allocated isn't it? Doesn't it just copy it
> into the bio as usual? IE it works exactly how large reads
> currently work.
Yes, the driver reads all the data that it expects to get off the
socket for a given read request and then copies it into the bio's of
the request. nbd-client doesn't come into play here.
>> Besides eating up huge amounts of memory on the client side you get the
>> delay of having to wait for all the data again. Just on the other side
>> of the socket.
>
> I think you mean that the client can't complete parts of the request
> as the data comes in, because there might be an eventual error.
> This would be a problem except for the fact that you can't
> do this anyway (you either complete a request or don't). The
> atomic unit of a request is the whole request. And you can write
> straight where you would write eventually (as indeed the client
> does at the moment).
Right, the driver expects to get the amount of data that was requested
back from the nbd-server, except when the reply header indicates an
error, in which case it expects no data.
--
Paul
Reply to: