summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/dht/src/dht-helper.c5
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c32
2 files changed, 32 insertions, 5 deletions
diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c
index d68fa091c94..5a72db1176a 100644
--- a/xlators/cluster/dht/src/dht-helper.c
+++ b/xlators/cluster/dht/src/dht-helper.c
@@ -442,6 +442,11 @@ dht_local_wipe (xlator_t *this, dht_local_t *local)
local->selfheal.layout = NULL;
}
+ if (local->selfheal.refreshed_layout) {
+ dht_layout_unref (this, local->selfheal.refreshed_layout);
+ local->selfheal.refreshed_layout = NULL;
+ }
+
dht_lock_array_free (local->lock.locks, local->lock.lk_count);
GF_FREE (local->lock.locks);
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index b817c57f90c..6471d54cdfe 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -50,6 +50,22 @@
} \
void
+gf_defrag_free_container (struct dht_container *container)
+{
+ if (container) {
+ gf_dirent_entry_free (container->df_entry);
+
+ if (container->parent_loc) {
+ loc_wipe (container->parent_loc);
+ }
+
+ GF_FREE (container->parent_loc);
+
+ GF_FREE (container);
+ }
+}
+
+void
dht_set_global_defrag_error (gf_defrag_info_t *defrag, int ret)
{
LOCK (&defrag->lock);
@@ -1934,8 +1950,8 @@ gf_defrag_task (void *opaque)
goto out;
}
- gf_dirent_free (iterator->df_entry);
- GF_FREE (iterator);
+ gf_defrag_free_container (iterator);
+
continue;
} else {
@@ -2091,6 +2107,12 @@ gf_defrag_get_entry (xlator_t *this, int i, struct dht_container **container,
gf_uuid_copy (entry_loc.pargfid, loc->gfid);
entry_loc.inode->ia_type = df_entry->d_stat.ia_type;
+
+ if (xattr_rsp) {
+ dict_unref (xattr_rsp);
+ xattr_rsp = NULL;
+ }
+
ret = syncop_lookup (conf->local_subvols[i], &entry_loc,
&iatt, NULL, xattr_req, &xattr_rsp);
if (ret) {
@@ -2217,13 +2239,13 @@ gf_defrag_get_entry (xlator_t *this, int i, struct dht_container **container,
}
out:
+ loc_wipe (&entry_loc);
+
if (ret == 0) {
*container = tmp_container;
} else {
if (tmp_container) {
- GF_FREE (tmp_container->df_entry);
- GF_FREE (tmp_container->parent_loc);
- GF_FREE (tmp_container);
+ gf_defrag_free_container (tmp_container);
}
}