summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2014-05-07 21:38:46 +0530
committerNiels de Vos <ndevos@redhat.com>2014-06-24 00:27:12 -0700
commit8cbe743dd972e934265e9a4186359be63c77d9f1 (patch)
tree22a404e5bf74f70c5a532d73b16f275959f44d82
parentc281db2a165694718d6f0a679c0f5f06eaf1cd17 (diff)
protocol/client,server: Suppress ESTALE logs
Backport of http://review.gluster.org/7696 Change-Id: I5372b45243ad9a68a7c20290e9f5fd5ca9ab28f2 BUG: 1095256 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8087 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
-rw-r--r--xlators/protocol/client/src/client-rpc-fops.c1
-rw-r--r--xlators/protocol/server/src/server-rpc-fops.c133
2 files changed, 75 insertions, 59 deletions
diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c
index 01590d73afc..38bc7b6238f 100644
--- a/xlators/protocol/client/src/client-rpc-fops.c
+++ b/xlators/protocol/client/src/client-rpc-fops.c
@@ -1095,6 +1095,7 @@ out:
if (rsp.op_ret == -1) {
gf_log (this->name, (((op_errno == ENOTSUP) ||
(op_errno == ENODATA) ||
+ (op_errno == ESTALE) ||
(op_errno == ENOENT)) ?
GF_LOG_DEBUG : GF_LOG_WARNING),
"remote operation failed: %s. Path: %s (%s). Key: %s",
diff --git a/xlators/protocol/server/src/server-rpc-fops.c b/xlators/protocol/server/src/server-rpc-fops.c
index c56da30a778..b6b74dd2b2f 100644
--- a/xlators/protocol/server/src/server-rpc-fops.c
+++ b/xlators/protocol/server/src/server-rpc-fops.c
@@ -30,6 +30,41 @@
ret = RPCSVC_ACTOR_ERROR; \
} while (0)
+static gf_loglevel_t
+fop_log_level (glusterfs_fop_t fop, int op_errno)
+{
+ //if gfid doesn't exist ESTALE comes
+ if (op_errno == ENOENT || op_errno == ESTALE)
+ return GF_LOG_DEBUG;
+
+ if ((fop == GF_FOP_ENTRYLK) ||
+ (fop == GF_FOP_FENTRYLK)||
+ (fop == GF_FOP_FINODELK)||
+ (fop == GF_FOP_INODELK) ||
+ (fop == GF_FOP_LK)) {
+ //if non-blocking lock fails EAGAIN comes
+ //if locks xlator is not loaded ENOSYS comes
+ if (op_errno == EAGAIN || op_errno == ENOSYS)
+ return GF_LOG_DEBUG;
+ }
+
+ if ((fop == GF_FOP_GETXATTR) ||
+ (fop == GF_FOP_FGETXATTR)) {
+ if (op_errno == ENOTSUP || op_errno == ENODATA)
+ return GF_LOG_DEBUG;
+ }
+
+ if ((fop == GF_FOP_SETXATTR) ||
+ (fop == GF_FOP_FSETXATTR)||
+ (fop == GF_FOP_REMOVEXATTR)||
+ (fop == GF_FOP_FREMOVEXATTR)) {
+ if (op_errno == ENOTSUP)
+ return GF_LOG_DEBUG;
+ }
+
+ return GF_LOG_ERROR;
+}
+
/* Callback function section */
int
server_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
@@ -137,8 +172,8 @@ out:
if (op_ret) {
if (state->resolve.bname) {
- gf_log (this->name, ((op_errno == ENOENT) ?
- GF_LOG_TRACE : GF_LOG_INFO),
+ gf_log (this->name,
+ fop_log_level (GF_FOP_LOOKUP, op_errno),
"%"PRId64": LOOKUP %s (%s/%s) ==> "
"(%s)", frame->root->unique,
state->loc.path,
@@ -146,8 +181,8 @@ out:
state->resolve.bname,
strerror (op_errno));
} else {
- gf_log (this->name, ((op_errno == ENOENT) ?
- GF_LOG_TRACE : GF_LOG_INFO),
+ gf_log (this->name,
+ fop_log_level (GF_FOP_LOOKUP, op_errno),
"%"PRId64": LOOKUP %s (%s) ==> (%s)",
frame->root->unique, state->loc.path,
uuid_utoa (state->resolve.gfid),
@@ -178,15 +213,13 @@ server_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
rsp.xdata.xdata_len, op_errno, out);
if (op_ret) {
- if ((op_errno != ENOSYS) && (op_errno != EAGAIN)) {
- state = CALL_STATE (frame);
- gf_log (this->name, GF_LOG_INFO,
- "%"PRId64": LK %"PRId64" (%s) ==> "
- "(%s)", frame->root->unique,
- state->resolve.fd_no,
- uuid_utoa (state->resolve.gfid),
- strerror (op_errno));
- }
+ state = CALL_STATE (frame);
+ gf_log (this->name, fop_log_level (GF_FOP_LK, op_errno),
+ "%"PRId64": LK %"PRId64" (%s) ==> "
+ "(%s)", frame->root->unique,
+ state->resolve.fd_no,
+ uuid_utoa (state->resolve.gfid),
+ strerror (op_errno));
goto out;
}
@@ -236,14 +269,11 @@ server_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE (frame);
if (op_ret < 0) {
- if ((op_errno != ENOSYS) && (op_errno != EAGAIN)) {
- gf_log (this->name, (op_errno == ENOENT)?
- GF_LOG_DEBUG:GF_LOG_ERROR,
- "%"PRId64": INODELK %s (%s) ==> (%s)",
- frame->root->unique, state->loc.path,
- uuid_utoa (state->resolve.gfid),
- strerror (op_errno));
- }
+ gf_log (this->name, fop_log_level (GF_FOP_INODELK, op_errno),
+ "%"PRId64": INODELK %s (%s) ==> (%s)",
+ frame->root->unique, state->loc.path,
+ uuid_utoa (state->resolve.gfid),
+ strerror (op_errno));
goto out;
}
@@ -275,14 +305,12 @@ server_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE (frame);
if (op_ret < 0) {
- if ((op_errno != ENOSYS) && (op_errno != EAGAIN)) {
- gf_log (this->name, GF_LOG_INFO,
- "%"PRId64": FINODELK %"PRId64" (%s) "
- "==> (%s)", frame->root->unique,
- state->resolve.fd_no,
- uuid_utoa (state->resolve.gfid),
- strerror (op_errno));
- }
+ gf_log (this->name, fop_log_level (GF_FOP_FINODELK, op_errno),
+ "%"PRId64": FINODELK %"PRId64" (%s) "
+ "==> (%s)", frame->root->unique,
+ state->resolve.fd_no,
+ uuid_utoa (state->resolve.gfid),
+ strerror (op_errno));
goto out;
}
@@ -313,13 +341,11 @@ server_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE (frame);
if (op_ret < 0) {
- if ((op_errno != ENOSYS) && (op_errno != EAGAIN)) {
- gf_log (this->name, GF_LOG_INFO,
- "%"PRId64": ENTRYLK %s (%s) ==> (%s)",
- frame->root->unique, state->loc.path,
- uuid_utoa (state->resolve.gfid),
- strerror (op_errno));
- }
+ gf_log (this->name, fop_log_level (GF_FOP_ENTRYLK, op_errno),
+ "%"PRId64": ENTRYLK %s (%s) ==> (%s)",
+ frame->root->unique, state->loc.path,
+ uuid_utoa (state->resolve.gfid),
+ strerror (op_errno));
goto out;
}
@@ -351,13 +377,11 @@ server_fentrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE (frame);
if (op_ret < 0) {
- if ((op_errno != ENOSYS) && (op_errno != EAGAIN)) {
- gf_log (this->name, GF_LOG_INFO,
- "%"PRId64": FENTRYLK %"PRId64" (%s) ==>(%s)",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa (state->resolve.gfid),
- strerror (op_errno));
- }
+ gf_log (this->name, fop_log_level (GF_FOP_FENTRYLK, op_errno),
+ "%"PRId64": FENTRYLK %"PRId64" (%s) ==>(%s)",
+ frame->root->unique, state->resolve.fd_no,
+ uuid_utoa (state->resolve.gfid),
+ strerror (op_errno));
goto out;
}
@@ -652,8 +676,7 @@ server_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE (frame);
- gf_log (this->name, (op_errno == ENOENT)?
- GF_LOG_DEBUG:GF_LOG_ERROR,
+ gf_log (this->name, fop_log_level (GF_FOP_OPENDIR, op_errno),
"%"PRId64": OPENDIR %s (%s) ==> (%s)",
frame->root->unique, state->loc.path,
uuid_utoa (state->resolve.gfid), strerror (op_errno));
@@ -766,10 +789,7 @@ server_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret == -1) {
state = CALL_STATE (frame);
- gf_log (this->name, (((op_errno == ENOTSUP) ||
- (op_errno == ENODATA) ||
- (op_errno == ENOENT)) ?
- GF_LOG_DEBUG : GF_LOG_INFO),
+ gf_log (this->name, fop_log_level (GF_FOP_GETXATTR, op_errno),
"%"PRId64": GETXATTR %s (%s) (%s) ==> (%s)",
frame->root->unique, state->loc.path,
uuid_utoa (state->resolve.gfid),
@@ -810,8 +830,7 @@ server_fgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret == -1) {
state = CALL_STATE (frame);
- gf_log (this->name, ((op_errno == ENOTSUP) ?
- GF_LOG_DEBUG : GF_LOG_INFO),
+ gf_log (this->name, fop_log_level (GF_FOP_FGETXATTR, op_errno),
"%"PRId64": FGETXATTR %"PRId64" (%s) (%s) ==> (%s)",
frame->root->unique, state->resolve.fd_no,
uuid_utoa (state->resolve.gfid),
@@ -1050,8 +1069,7 @@ server_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE (frame);
if (op_ret) {
- gf_log (this->name, (op_errno == ENOENT)?
- GF_LOG_DEBUG:GF_LOG_ERROR,
+ gf_log (this->name, fop_log_level (GF_FOP_UNLINK, op_errno),
"%"PRId64": UNLINK %s (%s/%s) ==> (%s)",
frame->root->unique, state->loc.path,
uuid_utoa (state->resolve.pargfid),
@@ -1311,8 +1329,7 @@ server_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE (frame);
- gf_log (this->name, (op_errno == ENOENT)?
- GF_LOG_DEBUG:GF_LOG_ERROR,
+ gf_log (this->name, fop_log_level (GF_FOP_FLUSH, op_errno),
"%"PRId64": FLUSH %"PRId64" (%s) ==> (%s)",
frame->root->unique, state->resolve.fd_no,
uuid_utoa (state->resolve.gfid), strerror (op_errno));
@@ -1511,8 +1528,7 @@ server_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE (frame);
- gf_log (this->name, (op_errno == ENOENT)?
- GF_LOG_DEBUG:GF_LOG_ERROR,
+ gf_log (this->name, fop_log_level (GF_FOP_OPEN, op_errno),
"%"PRId64": OPEN %s (%s) ==> (%s)",
frame->root->unique, state->loc.path,
uuid_utoa (state->resolve.gfid),
@@ -1687,8 +1703,7 @@ server_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE (frame);
- gf_log (this->name, (op_errno == ENOENT)?
- GF_LOG_DEBUG:GF_LOG_ERROR,
+ gf_log (this->name, fop_log_level (GF_FOP_STAT, op_errno),
"%"PRId64": STAT %s (%s) ==> (%s)",
frame->root->unique, state->loc.path,
uuid_utoa (state->resolve.gfid),