From 967171f76dc91bf23bc7853147975ac882881039 Mon Sep 17 00:00:00 2001 From: Susant Palai Date: Mon, 24 Apr 2017 16:27:23 +0530 Subject: cluster/dht: correct space check for rebalance With rebalance doing fallocate on destination, we don't need to add file size to the "destination available space" to decide whether to migrate the file or not. Notes: Fallocate would have already occupied the file size space on destination > Change-Id: If7f6a6654e6257726680cf20d618482a6e9095a6 > BUG: 1441508 > Signed-off-by: Susant Palai > Reviewed-on: https://review.gluster.org/17104 > Smoke: Gluster Build System > NetBSD-regression: NetBSD Build System > CentOS-regression: Gluster Build System > Reviewed-by: Amar Tumballi > Reviewed-by: N Balachandran > Reviewed-by: Raghavendra G > Signed-off-by: Susant Palai Change-Id: If7f6a6654e6257726680cf20d618482a6e9095a6 BUG: 1473133 Signed-off-by: Susant Palai Reviewed-on: https://review.gluster.org/17833 CentOS-regression: Gluster Build System Smoke: Gluster Build System Reviewed-by: Shyamsundar Ranganathan --- xlators/cluster/dht/src/dht-rebalance.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c index 117146b599c..65b4d329532 100644 --- a/xlators/cluster/dht/src/dht-rebalance.c +++ b/xlators/cluster/dht/src/dht-rebalance.c @@ -842,7 +842,7 @@ __dht_check_free_space (xlator_t *to, xlator_t *from, loc_t *loc, src_statfs_blocks = ((src_statfs.f_bavail * src_statfs.f_bsize) / GF_DISK_SECTOR_SIZE); - if ((dst_statfs_blocks - stbuf->ia_blocks) < + if ((dst_statfs_blocks) < (src_statfs_blocks + stbuf->ia_blocks)) { gf_msg (this->name, GF_LOG_WARNING, 0, -- cgit