diff options
| author | Amar Tumballi <amar@gluster.com> | 2011-04-10 05:30:45 +0000 | 
|---|---|---|
| committer | Anand Avati <avati@gluster.com> | 2011-04-10 23:52:33 -0700 | 
| commit | b003ee6e9e8316a59a1de204f727748e442ef0af (patch) | |
| tree | 1bffe645d2f435c309ee79217210550e40288157 | |
| parent | a6ec94de9346f2973d013237cc6584ff9aa89974 (diff) | |
protocol/server: prevent unnessary logs in INFO level
'op_ret == 0' in readdir() is a valid return code.
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2346 (Log message enhancements in GlusterFS - phase 1)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346
| -rw-r--r-- | xlators/protocol/server/src/server3_1-fops.c | 21 | 
1 files changed, 11 insertions, 10 deletions
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:  | 
