From 375f08e1b56f61c5687bb276fb95bea230085f77 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Fri, 22 Jan 2010 08:53:49 +0000 Subject: transport: set proper reference counts on peer_trans for local connections Signed-off-by: Anand V. Avati BUG: 562 (crash resulting from bad refs in transport_setpeer) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=562 --- libglusterfs/src/transport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libglusterfs/src/transport.c b/libglusterfs/src/transport.c index 56781efe8db..f3175272d12 100644 --- a/libglusterfs/src/transport.c +++ b/libglusterfs/src/transport.c @@ -421,7 +421,7 @@ transport_peerproc (void *trans_data) int transport_setpeer (transport_t *trans, transport_t *peer_trans) { - trans->peer_trans = peer_trans; + trans->peer_trans = transport_ref (peer_trans); INIT_LIST_HEAD (&trans->handover.msgs); pthread_cond_init (&trans->handover.cond, NULL); @@ -429,7 +429,7 @@ transport_setpeer (transport_t *trans, transport_t *peer_trans) pthread_create (&trans->handover.thread, NULL, transport_peerproc, trans); - peer_trans->peer_trans = trans; + peer_trans->peer_trans = transport_ref (trans); INIT_LIST_HEAD (&peer_trans->handover.msgs); pthread_cond_init (&peer_trans->handover.cond, NULL); -- cgit