ctdb-locking: Reset ttimer before doing an early return
authorAmitay Isaacs <amitay@gmail.com>
Thu, 25 Sep 2014 02:44:59 +0000 (12:44 +1000)
committerMartin Schwenke <martins@samba.org>
Thu, 25 Sep 2014 02:54:10 +0000 (04:54 +0200)
When timer expires, timeout handler routine sets lock_ctx->ttimer
to a newly created timer event.  However, when a node is INACTIVE,
timeout handler returns early with lock_ctx->ttimer set to the previous
timer event.  This timer event gets freed when the callback returns and
lock_ctx->ttimer remains set to already freed timer event.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/server/ctdb_lock.c

index e6653102ac68291e5929a8583686ff51574834e6..3a9b32703b7784de447a4a75b804169342e930f3 100644 (file)
@@ -492,6 +492,7 @@ static void ctdb_lock_timeout_handler(struct tevent_context *ev,
 
        /* If a node stopped/banned, don't spam the logs */
        if (ctdb->nodes[ctdb->pnn]->flags & NODE_FLAGS_INACTIVE) {
+               lock_ctx->ttimer = NULL;
                return;
        }
        if (lock_ctx->ctdb_db) {