diff options
author | Vijaykumar M <vmallika@redhat.com> | 2014-01-03 12:11:19 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2014-02-08 11:30:50 -0800 |
commit | 1e26f070bb470adafd0a316c18f2fb9e1b103f27 (patch) | |
tree | 1d04f49b423d579a3b1a2c7b1c2dfabadd3b7c4f /xlators/mgmt/glusterd/src/glusterd-volume-ops.c | |
parent | 8b5b2bfcda0dc95aa170b8752ad97d94701172f2 (diff) |
glusterd: add volinfo to the list data structure in an order
Currently volinfo is added at the end of the list while creating a volume.
On gluster restart, readdir will not provide the ordered list and the data
is populated in the same order as readdir.
Solution is to insert the volinfo to the list in an order
Change-Id: I1716ac6abbd7dd301a7125425fc413c6833f7a48
BUG: 1039912
Signed-off-by: Vijaykumar M <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/6472
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-ops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index 051e7d7569e..4acea768662 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -1708,7 +1708,8 @@ glusterd_op_create_volume (dict_t *dict, char **op_errstr) } volinfo->rebal.defrag_status = 0; - list_add_tail (&volinfo->vol_list, &priv->volumes); + list_add_order (&volinfo->vol_list, &priv->volumes, + glusterd_compare_volume_name); vol_added = _gf_true; out: |