Re: [Nbd] [PATCH] Only send one reply on oversize writes
- To: Wouter Verhelst <w@...112...>
- Cc: nbd-general@lists.sourceforge.net
- Subject: Re: [Nbd] [PATCH] Only send one reply on oversize writes
- From: Alex Bligh <alex@...872...>
- Date: Sat, 28 May 2011 10:45:20 +0100
- Message-id: <33FC6E538A76BA35B1D798B4@...874...>
- Reply-to: Alex Bligh <alex@...872...>
- In-reply-to: <20110528085523.GC32221@...510...>
- References: <1306560268-19484-1-git-send-email-alex@...872...> <20110528085523.GC32221@...510...>
Wouter,
--On 28 May 2011 10:55:23 +0200 Wouter Verhelst <w@...112...> wrote:
The oversize does check oversized writes, but it doesn't do more than
'check whether the server returns something', in the way of the
throughput test. It would be a good idea to check the handle, indeed.
The tests are pretty basic. They're better than nothing, but I am very
much aware that their coverage is... minimal. Your 'integrity' test has
just ramped up the coverage by a gazillion, which is great. Thanks for
that.
Even the integrity test does a poor job testing for replies. I
keep the inflight requests, then free them when the reply comes in.
I do stomp over them, but essentially (just like the kernel) a
duplicate (or a bad handle) will access memory that has been freed
(or not allocated) because (just like the kernel) I am using the
pointer to the request as the handle. For that reason, I check
the magic in the /tester's/ copy of the request block too, and
stomp over it before freeing, which hopefully should catch things
before a SEGV, but isn't guaranteed to. To do it properly, I either
need to do a hack into the malloc library ("does this pointer
point to a block of size X") or maintain a red/black tree or
similar of outstanding requests - queues won't do it as tens of
thousands of packets can be inflight at once. This seemed too much
like hard work.
--
Alex Bligh
Reply to: