search for: 1f8f789

Displaying 4 results from an estimated 4 matches for "1f8f789".

2019 Jun 18
0
[libnbd PATCH 3/8] pread: Reject server SR read response with no data chunks
...struct nbd_handle *h, type = cmd->type; error = cmd->error; + if (type == NBD_CMD_READ && !cmd->data_seen && !error) + error = EIO; /* Retire it from the list and free it. */ if (prev_cmd != NULL) diff --git a/lib/internal.h b/lib/internal.h index 6fde06c..1f8f789 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -242,6 +242,7 @@ struct command_in_flight { uint32_t count; void *data; /* Buffer for read/write, opaque for block status */ extent_fn extent_fn; + bool data_seen; /* For read, true if at least one data chunk seen */ uint32_t error; /...
2019 Jun 18
0
[libnbd PATCH 4/8] states: Prepare for read callback
...1) + if (cmd->cb.fn.extent (cmd->cb.opaque, meta_context->name, cmd->offset, + &h->bs_entries[1], (length-4) / 4) == -1) cmd->error = errno ? errno : EPROTO; } else diff --git a/lib/internal.h b/lib/internal.h index 1f8f789..cb0e170 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -231,7 +231,16 @@ struct socket { const struct socket_ops *ops; }; -typedef int (*extent_fn) (void *data, const char *metacontext, uint64_t offset, uint32_t *entries, size_t nr_entries); +typedef int (*extent_fn) (void *data, const c...
2019 Jun 20
1
Re: [libnbd PATCH 3/8] pread: Reject server SR read response with no data chunks
...;type; > error = cmd->error; > + if (type == NBD_CMD_READ && !cmd->data_seen && !error) > + error = EIO; > > /* Retire it from the list and free it. */ > if (prev_cmd != NULL) > diff --git a/lib/internal.h b/lib/internal.h > index 6fde06c..1f8f789 100644 > --- a/lib/internal.h > +++ b/lib/internal.h > @@ -242,6 +242,7 @@ struct command_in_flight { > uint32_t count; > void *data; /* Buffer for read/write, opaque for block status */ > extent_fn extent_fn; > + bool data_seen; /* For read, true if at least one data...
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