summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-threads/src/io-threads.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-09-27 08:55:55 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-27 11:57:58 -0700
commitedf5b0b4b89b46a566607d159b282c57298679db (patch)
tree0f4ed607568354240ce688fe611fe9a6baab1117 /xlators/performance/io-threads/src/io-threads.c
parentf4ff82641baf75cf534531a4dc2eb588db1218cb (diff)
io-threads: fix NULL dereference in 'reconfigure()'
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1715 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1715
Diffstat (limited to 'xlators/performance/io-threads/src/io-threads.c')
-rw-r--r--xlators/performance/io-threads/src/io-threads.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index 0fe034a3f39..72fbd567fcd 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -2088,9 +2088,12 @@ int
reconfigure ( xlator_t *this, dict_t *options)
{
iot_conf_t *conf = NULL;
- int ret = 0;
+ int ret = -1;
int thread_count;
-
+
+ conf = this->private;
+ if (!conf)
+ goto out;
if (dict_get (options, "thread-count")) {
thread_count = data_to_int32 (dict_get (options,
@@ -2100,7 +2103,6 @@ reconfigure ( xlator_t *this, dict_t *options)
gf_log ("io-threads", GF_LOG_WARNING,
"Number of threads opted is less then min rest"
"oring it to previous value",conf->max_count);
- ret = -1;
goto out;
}
@@ -2108,7 +2110,6 @@ reconfigure ( xlator_t *this, dict_t *options)
gf_log ("io-threads", GF_LOG_WARNING,
"Number of threads opted is greater than max "
"restoring it to previous value",conf->max_count);
- ret = -1;
goto out;
}
@@ -2119,8 +2120,6 @@ reconfigure ( xlator_t *this, dict_t *options)
out:
return ret;
-
-
}
int