diff options
| author | Anush Shetty <anush@gluster.com> | 2010-05-11 03:22:34 +0000 | 
|---|---|---|
| committer | Anand V. Avati <avati@dev.gluster.com> | 2010-05-11 10:10:15 -0700 | 
| commit | 19137b2f7e8a8adf85290ce0d234432d05edb09b (patch) | |
| tree | 4335e1fb3e167f9989bbb67d28a6509f3475552f | |
| parent | 5ff01302f737ab731d42c9d7b6d9137e29a90d46 (diff) | |
Adding GF_LOG_OCCASIONALLY to prevent repeated warning log messages in dht_is_subvol_filled
Signed-off-by: Anush Shetty <anush@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 912 (disk space full messages fill up the log file)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=912
| -rw-r--r-- | xlators/cluster/dht/src/dht-diskusage.c | 12 | 
1 files changed, 7 insertions, 5 deletions
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 <sys/time.h> +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));                  }          }  | 
