diff options
author | shishir gowda <shishirng@gluster.com> | 2010-09-09 05:55:53 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-09 12:19:43 -0700 |
commit | c1d8e31ad0b772149620465e79774cbf7b048d41 (patch) | |
tree | c5f672ae6e1c9e88da692a15340e8459d5c59da4 /xlators | |
parent | c1f4f9ba17fd40ef9c726a9599f3122f29ef0092 (diff) |
Fix incorrect logmsg about disk space in dht
Signed-off-by: shishir gowda <shishirng@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1573 (Incorrect information about disk space in dht)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1573
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/dht/src/dht-diskusage.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/xlators/cluster/dht/src/dht-diskusage.c b/xlators/cluster/dht/src/dht-diskusage.c index d2decd9d1..ee009d341 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; } |