Wouter Verhelst
2016-Sep-26 18:15 UTC
Re: [Libguestfs] [Nbd] Testing NBD server implementations for correctness
On Mon, Sep 26, 2016 at 11:43:42AM +0100, Alex Bligh wrote:> > > On 26 Sep 2016, at 10:21, Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> wrote: > > > > Wow, that was quick! Thank you. > > > > I stumbled upon another problem: Apparently nbd-tester-client and nbdkit > > disagree on what constitutes a valid flush request. > > nbd-tester-client complains: > > ./flush > > 15901: Requests: 3536 > > ** (process:15901): WARNING **: Could not run test: Received error from > > server: 22 (0x16). Handle is -9223372036854764544 (0x8000000000002C00). > > > > nbdkit complains: > > nbdkit: python[7]: error: invalid flush request: expecting offset and > > length == 0 > > > > Not sure where that bug is, nbdkit or nbd-tester-client. > > - Is the request correct and should have been accepted? > > - Is the reject correct, but the response is screwed up? > > Per the docs: > > • For a flush request, length and offset are reserved, and MUST be set to all-zero. > > So if nbd-tester-client.c is sending a flush with non-zero length or offset, it is wrong.Right. We have had cases in the past where out-in-the-wild implementations turned out to behave differently to how the spec behaved, but in this case I think it's a pretty safe bet to say that most implementations should generally DTRT here. I'm guessing that nbd-tester-client doesn't because of uninitialized code or something (haven't actually looked at it, must go, will do so later). TLDR: nbdkit is correct, nbd-tester-client is not, patches welcome. -- < ron> I mean, the main *practical* problem with C++, is there's like a dozen people in the world who think they really understand all of its rules, and pretty much all of them are just lying to themselves too. -- #debian-devel, OFTC, 2016-02-12
Alex Bligh
2016-Sep-26 18:37 UTC
Re: [Libguestfs] [Nbd] Testing NBD server implementations for correctness
> On 26 Sep 2016, at 19:15, Wouter Verhelst <w@uter.be> wrote: > > TLDR: nbdkit is correct, nbd-tester-client is not, patches welcome.I have pushed a fix. -- Alex Bligh
Carl-Daniel Hailfinger
2016-Sep-26 19:39 UTC
Re: [Libguestfs] [Nbd] Testing NBD server implementations for correctness
On 26.09.2016 20:37, Alex Bligh wrote:>> On 26 Sep 2016, at 19:15, Wouter Verhelst <w@uter.be> wrote: >> >> TLDR: nbdkit is correct, nbd-tester-client is not, patches welcome. > I have pushed a fix.Thank you, you beat me to it by a few minutes. Will test ASAP. Regards, Carl-Daniel
Seemingly Similar Threads
- Re: [Nbd] Testing NBD server implementations for correctness
- Re: [Nbd] Testing NBD server implementations for correctness
- Re: [Nbd] Testing NBD server implementations for correctness
- Re: [Nbd] Testing NBD server implementations for correctness
- [PATCH v2 1/6] spec: Recommend cap on NBD_REPLY_TYPE_BLOCK_STATUS length