From b145cd15ded130078c9f1105e76f35d0886e62d5 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Mon, 7 Mar 2016 11:52:18 +0530 Subject: protocol/server: Do not log ENOENT/ESTALE in fd based fops When fd-fops come on anon-fds there is a chance to log ENOENT/ESTALE for them. Log it as DEBUG. Change-Id: I8ae53c29d6a66f6a65081c281a9a5c205f53766b BUG: 1315168 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/13621 CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Ashish Pandey Reviewed-by: Jeff Darcy Smoke: Gluster Build System --- xlators/protocol/server/src/server-rpc-fops.c | 50 ++++++++++++++++----------- 1 file changed, 30 insertions(+), 20 deletions(-) (limited to 'xlators/protocol/server') diff --git a/xlators/protocol/server/src/server-rpc-fops.c b/xlators/protocol/server/src/server-rpc-fops.c index 239323382ea..9493df7906a 100644 --- a/xlators/protocol/server/src/server-rpc-fops.c +++ b/xlators/protocol/server/src/server-rpc-fops.c @@ -590,7 +590,7 @@ server_fsyncdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret < 0) { state = CALL_STATE (frame); - gf_msg (this->name, GF_LOG_INFO, + gf_msg (this->name, fop_log_level (GF_FOP_FSYNCDIR, op_errno), op_errno, PS_MSG_DIR_INFO, "%"PRId64": FSYNCDIR %"PRId64" (%s) ==> (%s)", frame->root->unique, state->resolve.fd_no, @@ -627,7 +627,7 @@ server_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret < 0) { state = CALL_STATE (frame); - gf_msg (this->name, GF_LOG_INFO, + gf_msg (this->name, fop_log_level (GF_FOP_READDIR, op_errno), op_errno, PS_MSG_DIR_INFO, "%"PRId64": READDIR %"PRId64" (%s) ==> (%s)", frame->root->unique, state->resolve.fd_no, @@ -765,7 +765,8 @@ server_fremovexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret == -1) { state = CALL_STATE (frame); - gf_msg (this->name, GF_LOG_INFO, op_errno, + gf_msg (this->name, + fop_log_level (GF_FOP_FREMOVEXATTR, op_errno), op_errno, PS_MSG_REMOVEXATTR_INFO, "%"PRId64": FREMOVEXATTR %"PRId64" (%s) (%s) ==> (%s)", frame->root->unique, state->resolve.fd_no, @@ -1272,7 +1273,8 @@ server_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret) { state = CALL_STATE (frame); - gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_STAT_INFO, + gf_msg (this->name, fop_log_level (GF_FOP_FSTAT, op_errno), + op_errno, PS_MSG_STAT_INFO, "%"PRId64": FSTAT %"PRId64" (%s) ==> (%s)", frame->root->unique, state->resolve.fd_no, uuid_utoa (state->resolve.gfid), strerror (op_errno)); @@ -1308,8 +1310,8 @@ server_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret) { state = CALL_STATE (frame); - gf_msg (this->name, GF_LOG_INFO, op_errno, - PS_MSG_TRUNCATE_INFO, + gf_msg (this->name, fop_log_level (GF_FOP_FTRUNCATE, op_errno), + op_errno, PS_MSG_TRUNCATE_INFO, "%"PRId64": FTRUNCATE %"PRId64" (%s)==> (%s)", frame->root->unique, state->resolve.fd_no, uuid_utoa (state->resolve.gfid), strerror (op_errno)); @@ -1380,7 +1382,8 @@ server_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret < 0) { state = CALL_STATE (frame); - gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_SYNC_INFO, + gf_msg (this->name, fop_log_level (GF_FOP_FSYNC, op_errno), + op_errno, PS_MSG_SYNC_INFO, "%"PRId64": FSYNC %"PRId64" (%s) ==> (%s)", frame->root->unique, state->resolve.fd_no, uuid_utoa (state->resolve.gfid), strerror (op_errno)); @@ -1417,7 +1420,8 @@ server_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret < 0) { state = CALL_STATE (frame); - gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_WRITE_INFO, + gf_msg (this->name, fop_log_level (GF_FOP_WRITE, op_errno), + op_errno, PS_MSG_WRITE_INFO, "%"PRId64": WRITEV %"PRId64" (%s) ==> (%s)", frame->root->unique, state->resolve.fd_no, uuid_utoa (state->resolve.gfid), strerror (op_errno)); @@ -1466,7 +1470,8 @@ server_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret < 0) { state = CALL_STATE (frame); - gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_READ_INFO, + gf_msg (this->name, fop_log_level (GF_FOP_READ, op_errno), + op_errno, PS_MSG_READ_INFO, "%"PRId64": READV %"PRId64" (%s) ==> (%s)", frame->root->unique, state->resolve.fd_no, uuid_utoa (state->resolve.gfid), strerror (op_errno)); @@ -1504,7 +1509,8 @@ server_rchecksum_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret < 0) { state = CALL_STATE (frame); - gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_CHKSUM_INFO, + gf_msg (this->name, fop_log_level (GF_FOP_RCHECKSUM, op_errno), + op_errno, PS_MSG_CHKSUM_INFO, "%"PRId64": RCHECKSUM %"PRId64" (%s)==> (%s)", frame->root->unique, state->resolve.fd_no, uuid_utoa (state->resolve.gfid), strerror (op_errno)); @@ -1806,7 +1812,8 @@ server_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret) { state = CALL_STATE (frame); - gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_SETATTR_INFO, + gf_msg (this->name, fop_log_level (GF_FOP_FSETATTR, op_errno), + op_errno, PS_MSG_SETATTR_INFO, "%"PRId64": FSETATTR %"PRId64" (%s) ==> (%s)", frame->root->unique, state->resolve.fd_no, uuid_utoa (state->resolve.gfid), @@ -1887,8 +1894,8 @@ server_fxattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret < 0) { state = CALL_STATE (frame); - gf_msg (this->name, GF_LOG_INFO, op_errno, - PS_MSG_XATTROP_INFO, + gf_msg (this->name, fop_log_level (GF_FOP_FXATTROP, op_errno), + op_errno, PS_MSG_XATTROP_INFO, "%"PRId64": FXATTROP %"PRId64" (%s) ==> (%s)", frame->root->unique, state->resolve.fd_no, uuid_utoa (state->resolve.gfid), @@ -1932,7 +1939,8 @@ server_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret < 0) { state = CALL_STATE (frame); - gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_DIR_INFO, + gf_msg (this->name, fop_log_level (GF_FOP_READDIRP, op_errno), + op_errno, PS_MSG_DIR_INFO, "%"PRId64": READDIRP %"PRId64" (%s) ==> (%s)", frame->root->unique, state->resolve.fd_no, uuid_utoa (state->resolve.gfid), @@ -1981,7 +1989,8 @@ server_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret) { state = CALL_STATE (frame); - gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_ALLOC_INFO, + gf_msg (this->name, fop_log_level (GF_FOP_FALLOCATE, op_errno), + op_errno, PS_MSG_ALLOC_INFO, "%"PRId64": FALLOCATE %"PRId64" (%s) ==> (%s)", frame->root->unique, state->resolve.fd_no, uuid_utoa (state->resolve.gfid), @@ -2019,7 +2028,8 @@ server_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret) { state = CALL_STATE (frame); - gf_msg (this->name, GF_LOG_INFO, op_errno, PS_MSG_DISCARD_INFO, + gf_msg (this->name, fop_log_level (GF_FOP_DISCARD, op_errno), + op_errno, PS_MSG_DISCARD_INFO, "%"PRId64": DISCARD %"PRId64" (%s) ==> (%s)", frame->root->unique, state->resolve.fd_no, uuid_utoa (state->resolve.gfid), @@ -2059,8 +2069,8 @@ server_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, rsp.xdata.xdata_len, op_errno, out); if (op_ret) { - gf_msg (this->name, GF_LOG_INFO, op_errno, - PS_MSG_ZEROFILL_INFO, + gf_msg (this->name, fop_log_level (GF_FOP_ZEROFILL, op_errno), + op_errno, PS_MSG_ZEROFILL_INFO, "%"PRId64": ZEROFILL%"PRId64" (%s) ==> (%s)", frame->root->unique, state->resolve.fd_no, uuid_utoa (state->resolve.gfid), @@ -2135,8 +2145,8 @@ server_seek_cbk (call_frame_t *frame, void *cookie, xlator_t *this, rsp.xdata.xdata_len, op_errno, out); if (op_ret) { - gf_msg (this->name, GF_LOG_INFO, op_errno, - PS_MSG_SEEK_INFO, + gf_msg (this->name, fop_log_level (GF_FOP_SEEK, op_errno), + op_errno, PS_MSG_SEEK_INFO, "%"PRId64": SEEK%"PRId64" (%s) ==> (%s)", frame->root->unique, state->resolve.fd_no, uuid_utoa (state->resolve.gfid), -- cgit