summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2012-05-18 14:58:52 +0530
committerVijay Bellur <vijay@gluster.com>2012-05-20 00:28:01 -0700
commit1d939fe7adef651b90bb5c4cd5843768417f0138 (patch)
tree1e48aaa058e430abfe2b1711ec1c82e5e4214ca6 /xlators/features
parentd54d9e9412a267ed8abaee1c682c7b6f734e8205 (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/3379 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/features')
-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 7d5f74e9c..a5ff2373f 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);
}