From fb2d84b8507354ed6128cacf4289f405cdc8bdc6 Mon Sep 17 00:00:00 2001 From: Anush Shetty Date: Fri, 7 May 2010 04:25:28 +0000 Subject: Adding GF_LOG_OCCASIONALLY to prevent repeated log messages Signed-off-by: Anush Shetty Signed-off-by: Anand V. Avati BUG: 10 ([ glusterfs 2.0.0 ] - Repeated Log messages with invalid remote-host in protocol/client) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=10 --- xlators/mount/fuse/src/fuse-bridge.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'xlators/mount') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index faf7c4815..9f210aa73 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -68,6 +68,8 @@ #define MAX_FUSE_PROC_DELAY 1 +static int gf_fuse_conn_err_log; + typedef struct fuse_in_header fuse_in_header_t; typedef void (fuse_handler_t) (xlator_t *this, fuse_in_header_t *finh, void *msg); @@ -719,11 +721,13 @@ fuse_attr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, send_fuse_data (this, finh, &fao, FUSE_COMPAT_ATTR_OUT_SIZE); } else { - gf_log ("glusterfs-fuse", GF_LOG_WARNING, - "%"PRIu64": %s() %s => -1 (%s)", frame->root->unique, - gf_fop_list[frame->root->op], - state->loc.path ? state->loc.path : "ERR", - strerror (op_errno)); + GF_LOG_OCCASIONALLY ( gf_fuse_conn_err_log, "glusterfs-fuse", + GF_LOG_WARNING, + "%"PRIu64": %s() %s => -1 (%s)", + frame->root->unique, + gf_fop_list[frame->root->op], + state->loc.path ? state->loc.path : "ERR", + strerror (op_errno)); send_fuse_err (this, finh, op_errno); } -- cgit