search for: recv_error_tail

Displaying 8 results from an estimated 8 matches for "recv_error_tail".

2019 Jun 14
1
[libnbd PATCH] states: Validate error message size
...a/generator/generator b/generator/generator index 3b0ca82..deb77f0 100755 --- a/generator/generator +++ b/generator/generator @@ -771,6 +771,13 @@ and structured_reply_state_machine = [ external_events = [ NotifyRead, "" ]; }; + State { + default_state with + name = "RECV_ERROR_TAIL"; + comment = "Receive a structured reply error tail"; + external_events = [ NotifyRead, "" ]; + }; + State { default_state with name = "RECV_OFFSET_DATA"; diff --git a/generator/states-reply-structured.c b/generator/states-reply-structured.c i...
2023 Jun 09
4
[libnbd PATCH v4 0/4] Saner reply header layout
This was v3 patch 2/22, reworked to address the confusion about how a structured reply header is read in two pieces before getting to the payload portion. I'm still working on rebasing the rest of my v3 series (patches 1, 3-22) from other comments given, but this seemed independent enough that it's worth posting now rather than holding it up for the rest of the series. Eric Blake (4):
2023 Jun 20
1
[libnbd PATCH v4 4/4] internal: Refactor layout of replies in sbuf
...= sizeof h->sbuf.reply.payload.offset_hole; > SET_NEXT_STATE (%RECV_OFFSET_HOLE); > break; > > @@ -127,10 +127,10 @@ REPLY.CHUNK_REPLY.START: > * compliant, will favor the wire error over EPROTO during more > * length checks in RECV_ERROR_MESSAGE and RECV_ERROR_TAIL. > */ > - if (length < sizeof h->sbuf.sr.payload.error.error.error) > + if (length < sizeof h->sbuf.reply.payload.error.error.error) > goto resync; > - h->rbuf = &h->sbuf.sr.payload.error.error; > - h->rlen = MIN (lengt...
2019 Jun 18
0
[libnbd PATCH 1/8] states: Add state for structured reply completion
...set_error (0, "NBD_REPLY_FLAG_DONE must be set in NBD_REPLY_TYPE_NONE"); return -1; } - SET_NEXT_STATE (%^FINISH_COMMAND); + SET_NEXT_STATE (%FINISH); return 0; } else if (type == NBD_REPLY_TYPE_OFFSET_DATA) { @@ -225,7 +225,6 @@ REPLY.STRUCTURED_REPLY.RECV_ERROR_TAIL: struct command_in_flight *cmd; - uint16_t flags; uint64_t handle; uint32_t error; uint64_t offset; @@ -234,7 +233,6 @@ switch (recv_into_rbuf (h)) { case -1: SET_NEXT_STATE (%.DEAD); return -1; case 0: - flags = be16toh (h->sbuf.sr.structured_reply.flags); handle =...
2019 Jun 18
0
[libnbd PATCH 2/8] states: Consolidate search for current reply's command
...he server"); - return -1; - } + assert (cmd); + assert (cmd->handle == handle); /* Reject a server that replies with too much information, but don't * reject a single structured reply to NBD_CMD_READ on the largest @@ -224,8 +212,7 @@ return 0; REPLY.STRUCTURED_REPLY.RECV_ERROR_TAIL: - struct command_in_flight *cmd; - uint64_t handle; + struct command_in_flight *cmd = h->reply_cmd; uint32_t error; uint64_t offset; uint16_t type; @@ -233,15 +220,9 @@ switch (recv_into_rbuf (h)) { case -1: SET_NEXT_STATE (%.DEAD); return -1; case 0: - handle = be64toh...
2019 Jun 25
0
Re: [libnbd PATCH] states: Never block state machine inside REPLY
...h > name = "RECV_ERROR_MESSAGE"; > comment = "Receive a structured reply error message"; > - external_events = [ NotifyRead, "" ]; > + external_events = []; > }; > > State { > default_state with > name = "RECV_ERROR_TAIL"; > comment = "Receive a structured reply error tail"; > - external_events = [ NotifyRead, "" ]; > + external_events = []; > }; > > State { > default_state with > name = "RECV_OFFSET_DATA"; > comment = &q...
2019 Jun 19
4
[libnbd PATCH] states: Never block state machine inside REPLY
...= [] }; State { default_state with name = "RECV_ERROR_MESSAGE"; comment = "Receive a structured reply error message"; - external_events = [ NotifyRead, "" ]; + external_events = []; }; State { default_state with name = "RECV_ERROR_TAIL"; comment = "Receive a structured reply error tail"; - external_events = [ NotifyRead, "" ]; + external_events = []; }; State { default_state with name = "RECV_OFFSET_DATA"; comment = "Receive a structured reply offset-data he...
2019 Jun 18
17
[libnbd PATCH 0/8] Add nbd_pread_callback
I've mentioned this topic before (in fact, the idea of adding NBD_CMD_FLAG_DF was first mentioned at [1]), but finally finished enough of an implementation to feel confident in posting it. I'd still like to add something under examples/ that uses the new API to implement strict checking of a server's structured replies read implementation (ensure that a server never sends data after