diff options
author | Anand Avati <avati@gluster.com> | 2009-12-04 03:50:47 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-12-04 01:46:23 -0800 |
commit | 290a38912ce9f942f4ebdd24fcb0033214ecc537 (patch) | |
tree | c73ed4238ee2ecb65648e8f58af5ba95a01f1fb8 /xlators/protocol/server | |
parent | e7b86dedcdde48e37a2d50370998d7285624bdb8 (diff) |
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 <avati@blackhole.gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 430 (Server crash when client is killed)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=430
Diffstat (limited to 'xlators/protocol/server')
-rw-r--r-- | xlators/protocol/server/src/server-helpers.c | 10 |
1 files 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); |