Re: [PATCH] Pass SERVER* to send_export_info explicitly
On Wed, Nov 14, 2018 at 08:53:52PM +0100, Axel Wagner wrote:
> When the client sends a NBD_OPT_INFO request, commit_client is not
> called. So client->server does not get set, causing nbd-server to
> segfault. Passing the SERVER* explicitly allows us to send the export
> info without committing first.
> ---
> nbd-server.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/nbd-server.c b/nbd-server.c
> index ca5392a..b238eeb 100644
> --- a/nbd-server.c
> +++ b/nbd-server.c
> @@ -1942,22 +1942,22 @@ bool copyonwrite_prepare(CLIENT* client) {
> return true;
> }
>
> -void send_export_info(CLIENT* client, bool maybe_zeroes) {
> +void send_export_info(CLIENT* client, SERVER* server, bool maybe_zeroes) {
> uint64_t size_host = htonll((u64)(client->exportsize));
> uint16_t flags = NBD_FLAG_HAS_FLAGS | NBD_FLAG_SEND_WRITE_ZEROES;
Your mail client has completely messed up the whitespace in this patch.
Can you please send it again with some other client? Alternatively, a
public git repository would work, too.
Thanks,
--
To the thief who stole my anti-depressants: I hope you're happy
-- seen somewhere on the Internet on a photo of a billboard
Reply to: