From 19137b2f7e8a8adf85290ce0d234432d05edb09b Mon Sep 17 00:00:00 2001 From: Anush Shetty Date: Tue, 11 May 2010 03:22:34 +0000 Subject: Adding GF_LOG_OCCASIONALLY to prevent repeated warning log messages in dht_is_subvol_filled Signed-off-by: Anush Shetty Signed-off-by: Anand V. Avati BUG: 912 (disk space full messages fill up the log file) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=912 --- xlators/cluster/dht/src/dht-diskusage.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'xlators/cluster') diff --git a/xlators/cluster/dht/src/dht-diskusage.c b/xlators/cluster/dht/src/dht-diskusage.c index 6344953d09a..ceb8044d544 100644 --- a/xlators/cluster/dht/src/dht-diskusage.c +++ b/xlators/cluster/dht/src/dht-diskusage.c @@ -32,6 +32,7 @@ #include +static int gf_log_subvol_full; int dht_du_info_cbk (call_frame_t *frame, void *cookie, xlator_t *this, @@ -211,11 +212,12 @@ dht_is_subvol_filled (xlator_t *this, xlator_t *subvol) if (subvol_filled) { if (!(conf->du_stats[i].log++ % (GF_UNIVERSAL_ANSWER * 10))) { - gf_log (this->name, GF_LOG_WARNING, - "disk space on subvolume '%s' is getting " - "full (%.2f %%), consider adding more nodes", - subvol->name, - (100 - conf->du_stats[i].avail_percent)); + GF_LOG_OCCASIONALLY (gf_log_subvol_full, + this->name, GF_LOG_WARNING, + "disk space on subvolume '%s' is getting " + "full (%.2f %%), consider adding more nodes", + subvol->name, + (100 - conf->du_stats[i].avail_percent)); } } -- cgit