From 478ef9493f131c4d94bada708f790db3254f0a59 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 21 Jul 2014 09:48:45 +0000 Subject: [PATCH] ctdb: Fix verbose_memory_names If we have already partly written a packet, "data" and thus "pkt->data" does not point to the start of the packet anymore. Assign "hdr" while it still points at the start of the header. Signed-off-by: Volker Lendecke Reviewed-by: Amitay Isaacs Autobuild-User(master): Amitay Isaacs Autobuild-Date(master): Tue Jul 22 06:09:50 CEST 2014 on sn-devel-104 --- ctdb/common/ctdb_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctdb/common/ctdb_io.c b/ctdb/common/ctdb_io.c index 0a85f3bcd7a..b5f8a7274c4 100644 --- a/ctdb/common/ctdb_io.c +++ b/ctdb/common/ctdb_io.c @@ -286,6 +286,7 @@ static void queue_io_handler(struct event_context *ev, struct fd_event *fde, */ int ctdb_queue_send(struct ctdb_queue *queue, uint8_t *data, uint32_t length) { + struct ctdb_req_header *hdr = (struct ctdb_req_header *)data; struct ctdb_queue_pkt *pkt; uint32_t length2, full_length; @@ -345,7 +346,6 @@ int ctdb_queue_send(struct ctdb_queue *queue, uint8_t *data, uint32_t length) queue->out_queue_length++; if (queue->ctdb->tunable.verbose_memory_names != 0) { - struct ctdb_req_header *hdr = (struct ctdb_req_header *)pkt->data; switch (hdr->operation) { case CTDB_REQ_CONTROL: { struct ctdb_req_control *c = (struct ctdb_req_control *)hdr; -- 2.11.4.GIT