diff options
author | Amar Tumballi <amarts@redhat.com> | 2012-03-13 13:54:11 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-03-14 03:24:23 -0700 |
commit | 404e8f27d3a9e950173e02151eccbb792615e535 (patch) | |
tree | 8325dc4603975857f9bd4e8e39e33bdf7248d760 /xlators/cluster/dht/src/dht-rebalance.c | |
parent | 90333660ce4dd1fc94aa8f6b30c085d354f6693e (diff) |
distribute-rebalance: fix the logic of ENOENT handling
due to this, we were missing the entries from the last subvolume of
distribute for all the rebalance or remove-brick operations
Change-Id: I486f15c1d3d17cbf6f353f6179b2623af61f4868
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 770346
Reviewed-on: http://review.gluster.com/2933
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shishir Gowda <shishirng@gluster.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-rebalance.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-rebalance.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c index 0df20131a02..eaf5e89ce05 100644 --- a/xlators/cluster/dht/src/dht-rebalance.c +++ b/xlators/cluster/dht/src/dht-rebalance.c @@ -1058,6 +1058,7 @@ gf_defrag_migrate_data (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc, int32_t op_errno = 0; char *uuid_str = NULL; uuid_t node_uuid = {0,}; + int readdir_operrno = 0; gf_log (this->name, GF_LOG_INFO, "migate data called on %s", loc->path); @@ -1077,11 +1078,14 @@ gf_defrag_migrate_data (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc, INIT_LIST_HEAD (&entries.list); while ((ret = syncop_readdirp (this, fd, 131072, offset, NULL, - &entries)) != 0) - { - if ((ret < 0) || (ret && (errno == ENOENT))) + &entries)) != 0) { + if (ret < 0) break; + /* Need to keep track of ENOENT errno, that means, there is no + need to send more readdirp() */ + readdir_operrno = errno; + free_entries = _gf_true; if (list_empty (&entries.list)) @@ -1225,6 +1229,8 @@ gf_defrag_migrate_data (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc, free_entries = _gf_false; INIT_LIST_HEAD (&entries.list); + if (readdir_operrno == ENOENT) + break; } ret = 0; out: |