diff options
author | Nithya Balachandran <nbalacha@redhat.com> | 2014-11-07 15:29:45 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-11-11 08:37:39 -0800 |
commit | a24a354737577d466ed1c29be1c4fa6bf1a31e11 (patch) | |
tree | 1aabcf2510e22ffd18ba4bff4b5fa5beea8dc3b9 /xlators/cluster/dht | |
parent | ffa4263c2f8fcb95ed5553a5a114bc26a920ad27 (diff) |
Cluster/DHT : Rebalance skipped file count fix
The return value in dht_migrate_file is used to indicate the status
of the file migration. This value was being masked by the lock operation
causing the skipped and failure file counts to be incorrectly calculated.
Change-Id: Ice3d2f5d57766e18aa52659f22a76867d188dc65
BUG: 1161518
Signed-off-by: Nithya Balachandran <nbalacha@redhat.com>
Reviewed-on: http://review.gluster.org/9070
Reviewed-by: susant palai <spalai@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r-- | xlators/cluster/dht/src/dht-rebalance.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c index 85499737e30..42c9cde491f 100644 --- a/xlators/cluster/dht/src/dht-rebalance.c +++ b/xlators/cluster/dht/src/dht-rebalance.c @@ -897,6 +897,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to, struct gf_flock flock = {0, }; loc_t tmp_loc = {0, }; gf_boolean_t locked = _gf_false; + int lk_ret = -1; gf_log (this->name, GF_LOG_INFO, "%s: attempting to move from %s to %s", loc->path, from->name, to->name); @@ -1184,13 +1185,13 @@ out: if (locked) { flock.l_type = F_UNLCK; - ret = syncop_inodelk (from, DHT_FILE_MIGRATE_DOMAIN, &tmp_loc, - F_SETLK, &flock, NULL, NULL); - if (ret < 0) { + lk_ret = syncop_inodelk (from, DHT_FILE_MIGRATE_DOMAIN, + &tmp_loc, F_SETLK, &flock, NULL, NULL); + if (lk_ret < 0) { gf_msg (this->name, GF_LOG_WARNING, 0, DHT_MSG_MIGRATE_FILE_FAILED, "%s: failed to unlock file on %s (%s)", - loc->path, from->name, strerror (-ret)); + loc->path, from->name, strerror (-lk_ret)); } } |