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

Re: [Nbd] [PATCH] Only send one reply on oversize writes



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: