From d8bb87b4c7dd40adf4fe0ba0a0946483599e0acc Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 11 Aug 2010 05:58:31 +0000 Subject: rpc fixes * set THIS properly so memory accounting works fine. * also check for few pointers before dereferencing them. Signed-off-by: Amar Tumballi Signed-off-by: Anand V. Avati BUG: 1317 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1317 --- rpc/rpc-lib/src/rpc-transport.c | 3 +-- rpc/rpc-lib/src/rpc-transport.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'rpc/rpc-lib/src') diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c index 42274ed8d5f..c21d5ecfccd 100644 --- a/rpc/rpc-lib/src/rpc-transport.c +++ b/rpc/rpc-lib/src/rpc-transport.c @@ -956,6 +956,7 @@ rpc_transport_load (glusterfs_ctx_t *ctx, dict_t *options, char *trans_name) trans->options = options; pthread_mutex_init (&trans->lock, NULL); + trans->xl = THIS; return_trans = trans; return return_trans; @@ -1054,8 +1055,6 @@ rpc_transport_destroy (rpc_transport_t *this) GF_VALIDATE_OR_GOTO("rpc_transport", this, fail); - rpc_transport_disconnect (this); - if (this->fini) this->fini (this); pthread_mutex_destroy (&this->lock); diff --git a/rpc/rpc-lib/src/rpc-transport.h b/rpc/rpc-lib/src/rpc-transport.h index f6576fc1384..14ec8bc5719 100644 --- a/rpc/rpc-lib/src/rpc-transport.h +++ b/rpc/rpc-lib/src/rpc-transport.h @@ -170,6 +170,7 @@ struct rpc_transport { struct rpc_transport_ops *ops; void *private; void *xl_private; + void *xl; /* Used for THIS */ void *mydata; pthread_mutex_t lock; int32_t refcount; -- cgit