summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusant Palai <spalai@redhat.com>2017-04-24 16:27:23 +0530
committerRaghavendra G <rgowdapp@redhat.com>2017-04-25 16:28:19 +0000
commitdba51428dc16762a9489249f6d9b2e64c0b8303e (patch)
treecabfd36f0a825866ef29f7c98022e320facbbea4
parentdb0e5582b118d5bb0c8bb491f46fa2ae0dcfa97e (diff)
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 <spalai@redhat.com> Reviewed-on: https://review.gluster.org/17104 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: N Balachandran <nbalacha@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index c1174225138..d22360bacb9 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,