diff options
Diffstat (limited to 'xlators/cluster/dht/src/dht-rebalance.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-rebalance.c | 32 |
1 files changed, 27 insertions, 5 deletions
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); } } |