12a457
From 1ec9bec4d58f69dc1cab4c9fe246cf1b08d079cf Mon Sep 17 00:00:00 2001
12a457
From: Pranith Kumar K <pkarampu@redhat.com>
12a457
Date: Mon, 7 Mar 2016 11:52:18 +0530
12a457
Subject: [PATCH 107/139] protocol/server: Do not log ENOENT/ESTALE in fd based fops
12a457
12a457
When fd-fops come on anon-fds there is a chance to log ENOENT/ESTALE for them.
12a457
Log it as DEBUG.
12a457
12a457
 >Change-Id: I8ae53c29d6a66f6a65081c281a9a5c205f53766b
12a457
 >BUG: 1315168
12a457
 >Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
12a457
 >Reviewed-on: http://review.gluster.org/13621
12a457
 >CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
12a457
 >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
12a457
 >Reviewed-by: Ashish Pandey <aspandey@redhat.com>
12a457
 >Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
12a457
 >Smoke: Gluster Build System <jenkins@build.gluster.com>
12a457
12a457
 >BUG: 1322523
12a457
 >Change-Id: I4265bcb7dbdd70c3d0c7550434f743675313edf7
12a457
 >Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
12a457
 >Reviewed-on: http://review.gluster.org/14091
12a457
 >Smoke: Gluster Build System <jenkins@build.gluster.com>
12a457
 >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
12a457
 >CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
12a457
 >Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
12a457
12a457
BUG: 1294755
12a457
Change-Id: I811919bf7874d640f23de5d3cf5debad344ea114
12a457
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
12a457
Reviewed-on: https://code.engineering.redhat.com/gerrit/73478
12a457
---
12a457
 xlators/protocol/server/src/server-rpc-fops.c |   46 +++++++++++++++----------
12a457
 1 files changed, 28 insertions(+), 18 deletions(-)
12a457
12a457
diff --git a/xlators/protocol/server/src/server-rpc-fops.c b/xlators/protocol/server/src/server-rpc-fops.c
12a457
index 67c8797..25ffc0d 100644
12a457
--- a/xlators/protocol/server/src/server-rpc-fops.c
12a457
+++ b/xlators/protocol/server/src/server-rpc-fops.c
12a457
@@ -596,7 +596,7 @@ server_fsyncdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
12a457
 
12a457
         if (op_ret < 0) {
12a457
                 state = CALL_STATE (frame);
12a457
-                gf_msg (this->name, GF_LOG_INFO,
12a457
+                gf_msg (this->name, fop_log_level (GF_FOP_FSYNCDIR, op_errno),
12a457
                         op_errno, PS_MSG_DIR_INFO,
12a457
                         "%"PRId64": FSYNCDIR %"PRId64" (%s) ==> (%s)",
12a457
                         frame->root->unique, state->resolve.fd_no,
12a457
@@ -633,7 +633,7 @@ server_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
12a457
 
12a457
         if (op_ret < 0) {
12a457
                 state = CALL_STATE (frame);
12a457
-                gf_msg (this->name, GF_LOG_INFO,
12a457
+                gf_msg (this->name, fop_log_level (GF_FOP_READDIR, op_errno),
12a457
                         op_errno, PS_MSG_DIR_INFO,
12a457
                         "%"PRId64": READDIR %"PRId64" (%s) ==> (%s)",
12a457
                         frame->root->unique, state->resolve.fd_no,
12a457
@@ -771,7 +771,8 @@ server_fremovexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
12a457
 
12a457
         if (op_ret == -1) {
12a457
                 state = CALL_STATE (frame);
12a457
-                gf_msg (this->name, GF_LOG_INFO, op_errno,
12a457
+                gf_msg (this->name,
12a457
+                        fop_log_level (GF_FOP_FREMOVEXATTR, op_errno), op_errno,
12a457
                         PS_MSG_REMOVEXATTR_INFO,
12a457
                         "%"PRId64": FREMOVEXATTR %"PRId64" (%s) (%s) ==> (%s)",
12a457
                         frame->root->unique, state->resolve.fd_no,
12a457
@@ -1278,7 +1279,8 @@ server_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
12a457
 
12a457
         if (op_ret) {
12a457
                 state = CALL_STATE (frame);
12a457
-                gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_STAT_INFO,
12a457
+                gf_msg (this->name, fop_log_level (GF_FOP_FSTAT, op_errno),
12a457
+                        op_errno, PS_MSG_STAT_INFO,
12a457
                         "%"PRId64": FSTAT %"PRId64" (%s) ==> (%s)",
12a457
                         frame->root->unique, state->resolve.fd_no,
12a457
                         uuid_utoa (state->resolve.gfid), strerror (op_errno));
12a457
@@ -1314,8 +1316,8 @@ server_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
12a457
 
12a457
         if (op_ret) {
12a457
                 state = CALL_STATE (frame);
12a457
-                gf_msg (this->name, GF_LOG_INFO, op_errno,
12a457
-                        PS_MSG_TRUNCATE_INFO,
12a457
+                gf_msg (this->name, fop_log_level (GF_FOP_FTRUNCATE, op_errno),
12a457
+                        op_errno, PS_MSG_TRUNCATE_INFO,
12a457
                         "%"PRId64": FTRUNCATE %"PRId64" (%s)==> (%s)",
12a457
                         frame->root->unique, state->resolve.fd_no,
12a457
                         uuid_utoa (state->resolve.gfid), strerror (op_errno));
12a457
@@ -1386,7 +1388,8 @@ server_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
12a457
 
12a457
         if (op_ret < 0) {
12a457
                 state = CALL_STATE (frame);
12a457
-                gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_SYNC_INFO,
12a457
+                gf_msg (this->name, fop_log_level (GF_FOP_FSYNC, op_errno),
12a457
+                        op_errno, PS_MSG_SYNC_INFO,
12a457
                         "%"PRId64": FSYNC %"PRId64" (%s) ==> (%s)",
12a457
                         frame->root->unique, state->resolve.fd_no,
12a457
                         uuid_utoa (state->resolve.gfid), strerror (op_errno));
12a457
@@ -1423,7 +1426,8 @@ server_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
12a457
 
12a457
         if (op_ret < 0) {
12a457
                 state = CALL_STATE (frame);
12a457
-                gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_WRITE_INFO,
12a457
+                gf_msg (this->name, fop_log_level (GF_FOP_WRITE, op_errno),
12a457
+                        op_errno, PS_MSG_WRITE_INFO,
12a457
                         "%"PRId64": WRITEV %"PRId64" (%s) ==> (%s)",
12a457
                         frame->root->unique, state->resolve.fd_no,
12a457
                          uuid_utoa (state->resolve.gfid), strerror (op_errno));
12a457
@@ -1472,7 +1476,8 @@ server_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
12a457
 
12a457
         if (op_ret < 0) {
12a457
                 state = CALL_STATE (frame);
12a457
-                gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_READ_INFO,
12a457
+                gf_msg (this->name, fop_log_level (GF_FOP_READ, op_errno),
12a457
+                        op_errno, PS_MSG_READ_INFO,
12a457
                         "%"PRId64": READV %"PRId64" (%s) ==> (%s)",
12a457
                         frame->root->unique, state->resolve.fd_no,
12a457
                         uuid_utoa (state->resolve.gfid), strerror (op_errno));
12a457
@@ -1510,7 +1515,8 @@ server_rchecksum_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
12a457
 
12a457
         if (op_ret < 0) {
12a457
                 state = CALL_STATE (frame);
12a457
-                gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_CHKSUM_INFO,
12a457
+                gf_msg (this->name, fop_log_level (GF_FOP_RCHECKSUM, op_errno),
12a457
+                        op_errno, PS_MSG_CHKSUM_INFO,
12a457
                         "%"PRId64": RCHECKSUM %"PRId64" (%s)==> (%s)",
12a457
                         frame->root->unique, state->resolve.fd_no,
12a457
                         uuid_utoa (state->resolve.gfid), strerror (op_errno));
12a457
@@ -1808,7 +1814,8 @@ server_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
12a457
 
12a457
         if (op_ret) {
12a457
                 state  = CALL_STATE (frame);
12a457
-                gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_SETATTR_INFO,
12a457
+                gf_msg (this->name, fop_log_level (GF_FOP_FSETATTR, op_errno),
12a457
+                        op_errno, PS_MSG_SETATTR_INFO,
12a457
                         "%"PRId64": FSETATTR %"PRId64" (%s) ==> (%s)",
12a457
                         frame->root->unique, state->resolve.fd_no,
12a457
                         uuid_utoa (state->resolve.gfid),
12a457
@@ -1889,8 +1896,8 @@ server_fxattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
12a457
 
12a457
         if (op_ret < 0) {
12a457
                 state = CALL_STATE (frame);
12a457
-                gf_msg (this->name, GF_LOG_INFO, op_errno,
12a457
-                        PS_MSG_XATTROP_INFO,
12a457
+                gf_msg (this->name, fop_log_level (GF_FOP_FXATTROP, op_errno),
12a457
+                        op_errno, PS_MSG_XATTROP_INFO,
12a457
                         "%"PRId64": FXATTROP %"PRId64" (%s) ==> (%s)",
12a457
                         frame->root->unique, state->resolve.fd_no,
12a457
                         uuid_utoa (state->resolve.gfid),
12a457
@@ -1934,7 +1941,8 @@ server_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
12a457
 
12a457
         if (op_ret < 0) {
12a457
                 state = CALL_STATE (frame);
12a457
-                gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_DIR_INFO,
12a457
+                gf_msg (this->name, fop_log_level (GF_FOP_READDIRP, op_errno),
12a457
+                        op_errno, PS_MSG_DIR_INFO,
12a457
                         "%"PRId64": READDIRP %"PRId64" (%s) ==> (%s)",
12a457
                         frame->root->unique, state->resolve.fd_no,
12a457
                         uuid_utoa (state->resolve.gfid),
12a457
@@ -1983,7 +1991,8 @@ server_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
12a457
 
12a457
         if (op_ret) {
12a457
                 state  = CALL_STATE (frame);
12a457
-                gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_ALLOC_INFO,
12a457
+                gf_msg (this->name, fop_log_level (GF_FOP_FALLOCATE, op_errno),
12a457
+                        op_errno, PS_MSG_ALLOC_INFO,
12a457
                         "%"PRId64": FALLOCATE %"PRId64" (%s) ==> (%s)",
12a457
                         frame->root->unique, state->resolve.fd_no,
12a457
                         uuid_utoa (state->resolve.gfid),
12a457
@@ -2021,7 +2030,8 @@ server_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
12a457
 
12a457
         if (op_ret) {
12a457
                 state  = CALL_STATE (frame);
12a457
-                gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_DISCARD_INFO,
12a457
+                gf_msg (this->name, fop_log_level (GF_FOP_DISCARD, op_errno),
12a457
+                        op_errno, PS_MSG_DISCARD_INFO,
12a457
                         "%"PRId64": DISCARD %"PRId64" (%s) ==> (%s)",
12a457
                         frame->root->unique, state->resolve.fd_no,
12a457
                         uuid_utoa (state->resolve.gfid),
12a457
@@ -2061,8 +2071,8 @@ server_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
12a457
                                     rsp.xdata.xdata_len, op_errno, out);
12a457
 
12a457
         if (op_ret) {
12a457
-                gf_msg (this->name, GF_LOG_INFO, op_errno,
12a457
-                        PS_MSG_ZEROFILL_INFO,
12a457
+                gf_msg (this->name, fop_log_level (GF_FOP_ZEROFILL, op_errno),
12a457
+                        op_errno, PS_MSG_ZEROFILL_INFO,
12a457
                         "%"PRId64": ZEROFILL%"PRId64" (%s) ==> (%s)",
12a457
                         frame->root->unique, state->resolve.fd_no,
12a457
                         uuid_utoa (state->resolve.gfid),
12a457
-- 
12a457
1.7.1
12a457