diff options
| author | Raghavendra Bhat <raghavendrabhat@gluster.com> | 2012-01-17 10:50:21 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vijay@gluster.com> | 2012-01-19 22:29:46 -0800 | 
| commit | 8150c29276d6e84a936a5b12fff1daa1fdfc9adb (patch) | |
| tree | bfdde2a4b7e30944ceac08b06930c8be6aa12f8e | |
| parent | 1020a3dfe9834468be96040633369d69dc9aeef3 (diff) | |
performance/io-cache: if the reconfigure option given is wrong, then unlock and return
In io-cache reconfigure we take the lock on ioc_table_t, and then get the
options from the dict. If some value of some option given is wrong,
we are returning without unlocking, leading to the hang.
Change-Id: I5b3ebf0a8e9e2470d240b503167ff1731ff1b613
BUG: 782286
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/2649
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <fharshav@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
| -rw-r--r-- | xlators/performance/io-cache/src/io-cache.c | 19 | 
1 files changed, 10 insertions, 9 deletions
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index 830386e02..b74848f83 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -1545,7 +1545,7 @@ reconfigure (xlator_t *this, dict_t *options)                                  gf_log (this->name, GF_LOG_WARNING,                                          "cache-timeout %d seconds invalid,"                                          " has to be  >=0", cache_timeout); -                                goto out; +                                goto unlock;                          } @@ -1553,7 +1553,7 @@ reconfigure (xlator_t *this, dict_t *options)                                  gf_log (this->name, GF_LOG_WARNING,                                          "cache-timeout %d seconds invalid,"                                          " has to be  <=60", cache_timeout); -                                goto out; +                                goto unlock;                          }                          table->cache_timeout = cache_timeout; @@ -1577,7 +1577,7 @@ reconfigure (xlator_t *this, dict_t *options)                                          "invalid number format \"%s\" of "                                          "\"option cache-size\" Defaulting"                                          "to old value", cache_size_string); -                                goto out; +                                goto unlock;                          }                          if (cache_size < (4 * GF_UNIT_MB)) { @@ -1587,7 +1587,7 @@ reconfigure (xlator_t *this, dict_t *options)                                         "Max value can be 4MiB, Defaulting to "                                         "old value (%"PRIu64")",                                         cache_size_string, table->cache_size); -                                goto out; +                                goto unlock;                          }                          if (cache_size > (6 * GF_UNIT_GB)) { @@ -1597,7 +1597,7 @@ reconfigure (xlator_t *this, dict_t *options)                                          "Max value can be 6GiB, Defaulting to "                                          "old value (%"PRIu64")",                                          cache_size_string, table->cache_size); -                                goto out; +                                goto unlock;                          } @@ -1620,7 +1620,7 @@ reconfigure (xlator_t *this, dict_t *options)                          if (table->max_pri == -1) {                                  ret = -1; -                                goto out; +                                goto unlock;                          }                          table->max_pri ++;                  } @@ -1637,7 +1637,7 @@ reconfigure (xlator_t *this, dict_t *options)                                          "invalid number format \"%s\" of "                                          "\"option min-file-size\"", tmp);                                  ret = -1; -                                goto out; +                                goto unlock;                          }                          gf_log (this->name, GF_LOG_DEBUG, @@ -1655,7 +1655,7 @@ reconfigure (xlator_t *this, dict_t *options)                                          "invalid number format \"%s\" of "                                          "\"option max-file-size\"", tmp);                                  ret = -1; -                                goto out; +                                goto unlock;                          } @@ -1670,7 +1670,7 @@ reconfigure (xlator_t *this, dict_t *options)                                  "greater than maximum size (%"PRIu64"). "                                  "Hence Defaulting to old value",                                  table->min_file_size, table->max_file_size); -                        goto out; +                        goto unlock;                  }                  table->min_file_size = min_file_size; @@ -1681,6 +1681,7 @@ reconfigure (xlator_t *this, dict_t *options)                          table->max_file_size = 0;          } +unlock:          ioc_table_unlock (table);  out:          return ret;  | 
