summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-selfheal.c
diff options
context:
space:
mode:
authorRaghavendra G <rgowdapp@redhat.com>2015-02-24 16:36:05 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-03-06 00:57:00 -0800
commitc6bfde4da5da40f81ab7d96f4d43adb2553a633d (patch)
tree5c9a2bd67fe71d4e98455a0807d837d7c94e462d /xlators/cluster/dht/src/dht-selfheal.c
parent3797caabb95ad8e62dee74a5331d324ddffc654f (diff)
cluster/dht: create request dictionary if necessary during refresh
layout. Change-Id: I5a5d793c86ee5de345608eede5618e4e6c02af9f BUG: 1195668 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/9733
Diffstat (limited to 'xlators/cluster/dht/src/dht-selfheal.c')
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index 50c2805d51b..727b2d6027d 100644
--- a/xlators/cluster/dht/src/dht-selfheal.c
+++ b/xlators/cluster/dht/src/dht-selfheal.c
@@ -260,6 +260,13 @@ dht_refresh_layout (call_frame_t *frame)
dict_del (local->xattr, conf->xattr_name);
}
+ if (local->xattr_req == NULL) {
+ local->xattr_req = dict_new ();
+ if (local->xattr_req == NULL) {
+ goto out;
+ }
+ }
+
if (dict_get (local->xattr_req, conf->xattr_name) == 0) {
ret = dict_set_uint32 (local->xattr_req, conf->xattr_name,
4 * 4);
@@ -440,14 +447,14 @@ gf_boolean_t
dht_should_fix_layout (call_frame_t *frame, dht_layout_t **inmem,
dht_layout_t **ondisk)
{
- gf_boolean_t fixit = _gf_true;
- dht_local_t *local = NULL;
- int layout_span = 0;
- int ondisk_decommissioned_bricks = 0;
- int ret = 0;
- dht_conf_t *conf = NULL;
- dht_distribution_type_t inmem_dist_type = 0;
- dht_distribution_type_t ondisk_dist_type = 0;
+ gf_boolean_t fixit = _gf_true;
+ dht_local_t *local = NULL;
+ int layout_span = 0;
+ int decommissioned_bricks = 0;
+ int ret = 0;
+ dht_conf_t *conf = NULL;
+ dht_distribution_type_t inmem_dist_type = 0;
+ dht_distribution_type_t ondisk_dist_type = 0;
conf = frame->this->private;
@@ -477,13 +484,13 @@ dht_should_fix_layout (call_frame_t *frame, dht_layout_t **inmem,
layout_span = dht_layout_span (*ondisk);
- ondisk_decommissioned_bricks
+ decommissioned_bricks
= dht_decommissioned_bricks_in_layout (frame->this,
*ondisk);
inmem_dist_type = dht_distribution_type (frame->this, *inmem);
ondisk_dist_type = dht_distribution_type (frame->this, *ondisk);
- if ((ondisk_decommissioned_bricks == 0)
+ if ((decommissioned_bricks == 0)
&& (layout_span == (conf->subvolume_cnt
- conf->decommission_subvols_cnt))
&& (inmem_dist_type == ondisk_dist_type))