diff options
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/dht/src/dht-rebalance.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c index a026a0e1cd1..3ddfbb3534b 100644 --- a/xlators/cluster/dht/src/dht-rebalance.c +++ b/xlators/cluster/dht/src/dht-rebalance.c @@ -2070,6 +2070,10 @@ gf_defrag_task (void *opaque) while (_gf_true) { if (defrag->defrag_status != GF_DEFRAG_STATUS_STARTED) { + pthread_cond_broadcast ( + &defrag->rebalance_crawler_alarm); + pthread_cond_broadcast ( + &defrag->parallel_migration_cond); goto out; } @@ -2133,6 +2137,13 @@ gf_defrag_task (void *opaque) defrag->defrag_status = GF_DEFRAG_STATUS_FAILED; + + pthread_cond_broadcast ( + &defrag->rebalance_crawler_alarm); + + pthread_cond_broadcast ( + &defrag->parallel_migration_cond); + goto out; } @@ -2191,10 +2202,16 @@ gf_defrag_get_entry (xlator_t *this, int i, struct dht_container **container, xlator_t *hashed_subvol = NULL; xlator_t *cached_subvol = NULL; + if (defrag->defrag_status != GF_DEFRAG_STATUS_STARTED) { + ret = -1; + goto out; + } + if (dir_dfmeta->offset_var[i].readdir_done == 1) { ret = 0; goto out; } + if (dir_dfmeta->fetch_entries[i] == 1) { ret = syncop_readdirp (conf->local_subvols[i], fd, 131072, dir_dfmeta->offset_var[i].offset, |