From c1d8e31ad0b772149620465e79774cbf7b048d41 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Thu, 9 Sep 2010 05:55:53 +0000 Subject: Fix incorrect logmsg about disk space in dht Signed-off-by: shishir gowda Signed-off-by: Vijay Bellur BUG: 1573 (Incorrect information about disk space in dht) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1573 --- xlators/cluster/dht/src/dht-diskusage.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/xlators/cluster/dht/src/dht-diskusage.c b/xlators/cluster/dht/src/dht-diskusage.c index d2decd9d11b..ee009d34177 100644 --- a/xlators/cluster/dht/src/dht-diskusage.c +++ b/xlators/cluster/dht/src/dht-diskusage.c @@ -229,7 +229,6 @@ dht_free_disk_available_subvol (xlator_t *this, xlator_t *subvol) dht_conf_t *conf = NULL; conf = this->private; - avail_subvol = subvol; LOCK (&conf->subvolume_lock); { @@ -249,13 +248,16 @@ dht_free_disk_available_subvol (xlator_t *this, xlator_t *subvol) } UNLOCK (&conf->subvolume_lock); - if (max < conf->min_free_disk) - avail_subvol = subvol; - - if (avail_subvol == subvol) { + if (!avail_subvol) { gf_log (this->name, GF_LOG_DEBUG, "no subvolume has enough free space to create"); } - + + if (max < conf->min_free_disk) + avail_subvol = subvol; + + if (!avail_subvol) + avail_subvol = subvol; + return avail_subvol; } -- cgit