summaryrefslogtreecommitdiffstats
path: root/xlators/features/quota
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2012-05-18 14:58:52 +0530
committerAnand Avati <avati@redhat.com>2012-05-18 19:31:36 -0700
commit4aa7bc40c9f129d6bea738941dea5b95b80d58e9 (patch)
tree122937e7cf604c4d49d92e01c7485075d7781d40 /xlators/features/quota
parent6629bab3bf3c110ce275ad184b5e358272b7593a (diff)
features/quota: get the top xlator from the active graph outside the list
In quota reconfigure we were getting the top of the active graph within the list which contains the limits set on the volume. Suppose the list is empty, then the code inside the list traversal loop is not executed, and thus top will be NULL which might lead to segfault when accessed later. Change-Id: I1648d69256490878339294537e17300399ddbf2c BUG: 822827 Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Reviewed-on: http://review.gluster.com/3364 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/features/quota')
-rw-r--r--xlators/features/quota/src/quota.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
index 7d5f74e9cc8..a5ff2373fb6 100644
--- a/xlators/features/quota/src/quota.c
+++ b/xlators/features/quota/src/quota.c
@@ -3233,9 +3233,10 @@ reconfigure (xlator_t *this, dict_t *options)
LOCK (&priv->lock);
{
- list_for_each_entry (limit, &priv->limit_head, limit_list) {
- top = ((glusterfs_ctx_t *)this->ctx)->active->top;
+ top = ((glusterfs_ctx_t *)this->ctx)->active->top;
+ GF_ASSERT (top);
+ list_for_each_entry (limit, &priv->limit_head, limit_list) {
__quota_reconfigure (this, top->itable, limit);
}