From a24a354737577d466ed1c29be1c4fa6bf1a31e11 Mon Sep 17 00:00:00 2001 From: Nithya Balachandran Date: Fri, 7 Nov 2014 15:29:45 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/9070 Reviewed-by: susant palai Tested-by: Gluster Build System Reviewed-by: Shyamsundar Ranganathan Reviewed-by: Vijay Bellur --- xlators/cluster/dht/src/dht-rebalance.c | 9 +++++---- 1 file 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)); } } -- cgit