summaryrefslogtreecommitdiffstats
path: root/xlators/debug/trace/src/trace.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2010-02-25 15:37:57 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-03-04 03:12:51 -0800
commite180e55a9945c738043d148265eb40951e870a0f (patch)
tree8324195a0a23e6523914f83ae37ee12f191f4f1c /xlators/debug/trace/src/trace.c
parentcbe617301a264d4193c507c06e77a8445cdf8f25 (diff)
trace: Do not print results on failed readlink
Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 473 (Trace misreporting pre/post attributes for setattr.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=473
Diffstat (limited to 'xlators/debug/trace/src/trace.c')
-rw-r--r--xlators/debug/trace/src/trace.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/xlators/debug/trace/src/trace.c b/xlators/debug/trace/src/trace.c
index e28e4e966..66a31dbd2 100644
--- a/xlators/debug/trace/src/trace.c
+++ b/xlators/debug/trace/src/trace.c
@@ -558,12 +558,18 @@ trace_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
char *statstr = NULL;
if (trace_fop_names[GF_FOP_READLINK].enabled) {
- statstr = trace_stat_to_str (stbuf);
- gf_log (this->name, GF_LOG_NORMAL,
- "%"PRId64": (op_ret=%d, op_errno=%d, buf=%s, "
- "stbuf = { %s })",
- frame->root->unique, op_ret, op_errno, buf, statstr);
+ if (op_ret == 0) {
+ statstr = trace_stat_to_str (stbuf);
+ gf_log (this->name, GF_LOG_NORMAL,
+ "%"PRId64": (op_ret=%d, op_errno=%d, buf=%s, "
+ "stbuf = { %s })",
+ frame->root->unique, op_ret, op_errno, buf,
+ statstr);
+ } else
+ gf_log (this->name, GF_LOG_NORMAL,
+ "%"PRId64": (op_ret=%d, op_errno=%d",
+ frame->root->unique, op_ret, op_errno);
if (statstr)
FREE (statstr);