From 290a38912ce9f942f4ebdd24fcb0033214ecc537 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Fri, 4 Dec 2009 03:50:47 +0000 Subject: protcol/server: server_connection_destroy - destroy frame after issuing flush frame was getting destroyed after unlocking, but before issuing flush. This could result in corruption if an fd was opened between server_connection_cleanup and server_connection_destroy because of pending open calls in io-threads at the time of POLLERR disconnection Signed-off-by: Anand V. Avati Signed-off-by: Anand V. Avati BUG: 430 (Server crash when client is killed) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=430 --- xlators/protocol/server/src/server-helpers.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c index 5e681c507..112712e7f 100644 --- a/xlators/protocol/server/src/server-helpers.c +++ b/xlators/protocol/server/src/server-helpers.c @@ -802,11 +802,6 @@ server_connection_destroy (xlator_t *this, server_connection_t *conn) free (locker); } - state = CALL_STATE (frame); - if (state) - free (state); - STACK_DESTROY (frame->root); - pthread_mutex_lock (&(conn->lock)); { if (conn->fdtable) { @@ -836,6 +831,11 @@ server_connection_destroy (xlator_t *this, server_connection_t *conn) } } + state = CALL_STATE (frame); + if (state) + free (state); + STACK_DESTROY (frame->root); + gf_log (this->name, GF_LOG_INFO, "destroyed connection of %s", conn->id); -- cgit