summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorMohammed Junaid Ahmed <junaid@gluster.com>2011-03-28 07:21:51 +0000
committerVijay Bellur <vijay@dev.gluster.com>2011-03-29 04:14:53 -0700
commit4c246c02f4ab569fca92255b7efb819243711d6b (patch)
treed3497e4a7858a6c83a04d3aed05c4fea4726d46a /xlators
parentb6ffe3ed1d44fddaed2a5eb2586b0584bfc17d5a (diff)
mgmt/glusterd: Fix double free on quota limit-usage.
Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2595 (Quota: re-setting the space-limit crashes the glusterd on the same node) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2595
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 462671ae7ee..29c8d86e9f4 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -4058,7 +4058,7 @@ _glusterd_quota_remove_limits (char **quota_limits, char *path)
memcpy ((void *) &limits [i], (void *) &qlimits [i], size + 1);
} else {
skiplen = size + 1;
- size = len - i - size + 1;
+ size = len - i - size;
memcpy ((void *) &limits [i], (void *) &qlimits [i + skiplen], size);
break;
}
@@ -4436,7 +4436,7 @@ glusterd_quota_limit_usage (glusterd_volinfo_t *volinfo, dict_t *dict, char **op
quota_limits = value;
- ret = dict_set_dynstr (volinfo->dict, "features.limit-usage",
+ ret = dict_set_str (volinfo->dict, "features.limit-usage",
quota_limits);
if (ret) {
gf_log ("", GF_LOG_ERROR, "Unable to set quota limits" );
@@ -4484,7 +4484,7 @@ glusterd_quota_remove_limits (glusterd_volinfo_t *volinfo, dict_t *dict, char **
goto out;
if (quota_limits) {
- ret = dict_set_dynstr (volinfo->dict, "features.limit-usage",
+ ret = dict_set_str (volinfo->dict, "features.limit-usage",
quota_limits);
if (ret) {
gf_log ("", GF_LOG_ERROR, "Unable to set quota limits" );