summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src/client-rpc-fops.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2014-10-21 16:18:16 +0530
committerNiels de Vos <ndevos@redhat.com>2014-10-22 00:32:40 -0700
commit5fff385333db750561ffd026af09e52a8c8c16e6 (patch)
treedb77cdee6977a558b2d5401c297d5c0bf5092b9b /xlators/protocol/client/src/client-rpc-fops.c
parent946eecfff75d7c9f4df3890ce57311386fe6e994 (diff)
logs: Do selective logging for errnos
Backport of http://review.gluster.org/8918 http://review.gluster.org/8955 Problem: Just after replace-brick the mount logs are filled with ENOENT/ESTALE warning logs because the file is yet to be self-healed now that the brick is new. Fix: Do conditional logging for the logs. ENOENT/ESTALE will be logged at lower log level. Only when debug logs are enabled, these logs will be written to the logfile. BUG: 1155073 Change-Id: Icf06f2fc4f2f91e199de24a88bcb0ce9b8955ebd Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8960 Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/protocol/client/src/client-rpc-fops.c')
-rw-r--r--xlators/protocol/client/src/client-rpc-fops.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c
index 3c014915ef5..50d15ec5fdc 100644
--- a/xlators/protocol/client/src/client-rpc-fops.c
+++ b/xlators/protocol/client/src/client-rpc-fops.c
@@ -458,7 +458,8 @@ client3_3_open_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_log (this->name, fop_log_level (GF_FOP_OPEN,
+ gf_error_to_errno (rsp.op_errno)),
"remote operation failed: %s. Path: %s (%s)",
strerror (gf_error_to_errno (rsp.op_errno)),
local->loc.path, loc_gfid_utoa (&local->loc));
@@ -923,7 +924,8 @@ client3_3_flush_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_log (this->name, fop_log_level (GF_FOP_FLUSH,
+ gf_error_to_errno (rsp.op_errno)),
"remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
@@ -1524,9 +1526,10 @@ client3_3_inodelk_cbk (struct rpc_req *req, struct iovec *iov, int count,
rsp.op_errno, out);
out:
- if ((rsp.op_ret == -1) &&
- (EAGAIN != gf_error_to_errno (rsp.op_errno))) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ if (rsp.op_ret == -1) {
+ gf_log (this->name, fop_log_level (GF_FOP_INODELK,
+ gf_error_to_errno (rsp.op_errno)),
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (inodelk, frame, rsp.op_ret,
@@ -1574,9 +1577,10 @@ client3_3_finodelk_cbk (struct rpc_req *req, struct iovec *iov, int count,
rsp.op_errno, out);
out:
- if ((rsp.op_ret == -1) &&
- (EAGAIN != gf_error_to_errno (rsp.op_errno))) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ if (rsp.op_ret == -1) {
+ gf_log (this->name, fop_log_level (GF_FOP_FINODELK,
+ gf_error_to_errno (rsp.op_errno)),
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
} else if (rsp.op_ret == 0) {
if (local->attempt_reopen)
@@ -1626,9 +1630,10 @@ client3_3_entrylk_cbk (struct rpc_req *req, struct iovec *iov, int count,
rsp.op_errno, out);
out:
- if ((rsp.op_ret == -1) &&
- (EAGAIN != gf_error_to_errno (rsp.op_errno))) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ if (rsp.op_ret == -1) {
+ gf_log (this->name, fop_log_level (GF_FOP_ENTRYLK,
+ gf_error_to_errno (rsp.op_errno)),
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
@@ -2684,7 +2689,8 @@ client3_3_opendir_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_log (this->name, fop_log_level (GF_FOP_OPENDIR,
+ gf_error_to_errno (rsp.op_errno)),
"remote operation failed: %s. Path: %s (%s)",
strerror (gf_error_to_errno (rsp.op_errno)),
local->loc.path, loc_gfid_utoa (&local->loc));