From b003ee6e9e8316a59a1de204f727748e442ef0af Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sun, 10 Apr 2011 05:30:45 +0000 Subject: protocol/server: prevent unnessary logs in INFO level 'op_ret == 0' in readdir() is a valid return code. Signed-off-by: Amar Tumballi Signed-off-by: Anand Avati BUG: 2346 (Log message enhancements in GlusterFS - phase 1) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346 --- xlators/protocol/server/src/server3_1-fops.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'xlators/protocol/server/src/server3_1-fops.c') diff --git a/xlators/protocol/server/src/server3_1-fops.c b/xlators/protocol/server/src/server3_1-fops.c index 2d1e9d039..d234b8abf 100644 --- a/xlators/protocol/server/src/server3_1-fops.c +++ b/xlators/protocol/server/src/server3_1-fops.c @@ -583,9 +583,10 @@ server_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto unwind; } } else { - gf_log (this->name, GF_LOG_INFO, - "%"PRId64": READDIR %"PRId64" (%"PRId64") ==> %"PRId32" (%s)", - frame->root->unique, state->resolve.fd_no, + /* (op_ret == 0) is valid, and means EOF, don't log for that */ + gf_log (this->name, (op_ret) ? GF_LOG_INFO : GF_LOG_TRACE, + "%"PRId64": READDIR %"PRId64" (%"PRId64") ==> %"PRId32 + " (%s)", frame->root->unique, state->resolve.fd_no, state->fd ? state->fd->inode->ino : 0, op_ret, strerror (op_errno)); } @@ -1735,13 +1736,13 @@ server_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto out; } } else { - if (op_errno != ENOENT) - gf_log (this->name, GF_LOG_INFO, - "%"PRId64": READDIRP %"PRId64" (%"PRId64") ==>" - "%"PRId32" (%s)", - frame->root->unique, state->resolve.fd_no, - state->fd ? state->fd->inode->ino : 0, op_ret, - strerror (op_errno)); + /* (op_ret == 0) is valid, and means EOF, don't log for that */ + gf_log (this->name, (op_ret) ? GF_LOG_INFO : GF_LOG_TRACE, + "%"PRId64": READDIRP %"PRId64" (%"PRId64") ==>" + "%"PRId32" (%s)", + frame->root->unique, state->resolve.fd_no, + state->fd ? state->fd->inode->ino : 0, op_ret, + strerror (op_errno)); } out: -- cgit