Possible race condition between cleanup and dereferencing

Signed-off-by: shishir gowda <shishirng@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>

BUG: 1760 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1760
This commit is contained in:
shishir gowda 2010-10-07 03:20:59 +00:00 committed by Vijay Bellur
parent d4b0360c8c
commit 98e1ea0f17
8 changed files with 22 additions and 1 deletions

View File

@ -3941,6 +3941,7 @@ fini (xlator_t *this)
priv = this->private;
if (priv) {
this->private = NULL;
if (priv->xl_array)
GF_FREE (priv->xl_array);

View File

@ -1695,6 +1695,10 @@ fini (xlator_t *this)
conf = this->private;
if (!conf)
return;
this->private = NULL;
GF_FREE(conf);
gf_log (this->name, GF_LOG_NORMAL,

View File

@ -181,6 +181,9 @@ fini (xlator_t *this)
{
rot_13_private_t *priv = this->private;
if (!priv)
return;
this->private = NULL;
GF_FREE (priv);
return;

View File

@ -1885,6 +1885,9 @@ fini (xlator_t *this)
posix_locks_private_t *priv = NULL;
priv = this->private;
if (!priv)
return 0;
this->private = NULL;
GF_FREE (priv);
return 0;

View File

@ -777,7 +777,7 @@ sp_cache_add_entries (sp_cache_t *cache, gf_dirent_t *entries)
sp_private_t *priv = NULL;
this = cache->this;
if (this)
if (this && this->private)
priv = this->private;
LOCK (&cache->lock);
@ -3676,6 +3676,7 @@ fini (xlator_t *this)
mem_pool_destroy (priv->mem_pool);
LOCK_DESTROY (&priv->lock);
GF_FREE (priv);
this->private = NULL;
}
}
out:

View File

@ -3009,6 +3009,9 @@ fini (xlator_t *this)
{
wb_conf_t *conf = this->private;
if (!conf)
return;
this->private = NULL;
GF_FREE (conf);
return;
}

View File

@ -1547,6 +1547,9 @@ fini (transport_t *this)
{
socket_private_t *priv = this->private;
if (!priv)
return;
this->private = NULL;
gf_log (this->xl->name, GF_LOG_TRACE,
"transport %p destroyed", this);

View File

@ -4438,6 +4438,9 @@ void
fini (xlator_t *this)
{
struct posix_private *priv = this->private;
if (!priv)
return;
this->private = NULL;
sys_lremovexattr (priv->base_path, "trusted.glusterfs.test");
GF_FREE (priv);
return;