From b1cd5cb8a857ed3a95eab95179378283c8d41763 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Wed, 26 Aug 2015 15:24:39 +0530 Subject: mount/fuse: Log ENODATA as DEBUG in {f}removexattr Logging ENODATA errors for {f}removexattr at a higher loglevel does not add a lot of value and causes a log message flood as per multiple reports. Added a new cbk, fuse_removexattr_cbk() to be used with removexattr fops. ENODATA now gets logged at loglevel DEBUG in fuse_removexattr_cbk(). This also prevents more conditional checks in the common fuse_err_cbk() callback. Change-Id: I1585b4d627e0095022016c47d7fd212018a7194b BUG: 1248941 Signed-off-by: Vijay Bellur Reviewed-on: http://review.gluster.org/12015 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Raghavendra Bhat Reviewed-on: http://review.gluster.org/12041 --- xlators/mount/fuse/src/fuse-bridge.c | 45 ++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) (limited to 'xlators/mount/fuse/src') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index b67a60a76b1..f78b7d23e89 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -1204,6 +1204,47 @@ fuse_setattr (xlator_t *this, fuse_in_header_t *finh, void *msg) fuse_resolve_and_resume (state, fuse_setattr_resume); } +static int +fuse_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int32_t op_ret, int32_t op_errno, dict_t *xdata) +{ + fuse_state_t *state = NULL; + fuse_in_header_t *finh = NULL; + + GF_ASSERT (frame); + GF_ASSERT (frame->root); + + state = frame->root->state; + finh = state->finh; + + fuse_log_eh_fop(this, state, frame, op_ret, op_errno); + + if (op_ret == 0) { + gf_log ("glusterfs-fuse", GF_LOG_TRACE, + "%"PRIu64": %s() %s => 0", frame->root->unique, + gf_fop_list[frame->root->op], + state->loc.path ? state->loc.path : "ERR"); + + send_fuse_err (this, finh, 0); + } else { + gf_log ("glusterfs-fuse", + (ENODATA == op_errno) ? GF_LOG_DEBUG : GF_LOG_WARNING, + "%"PRIu64": %s() of %s on %s => -1 (%s)", + frame->root->unique, + gf_fop_list[frame->root->op], + state->name ? state->name : "", + state->loc.path ? state->loc.path : "ERR", + strerror (op_errno)); + + send_fuse_err (this, finh, op_errno); + } + + free_fuse_state (state); + STACK_DESTROY (frame->root); + + return 0; +} + static int fuse_err_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, dict_t *xdata) @@ -3549,14 +3590,14 @@ fuse_removexattr_resume (fuse_state_t *state) "%"PRIu64": REMOVEXATTR %p/%"PRIu64" (%s)", state->finh->unique, state->fd, state->finh->nodeid, state->name); - FUSE_FOP (state, fuse_err_cbk, GF_FOP_FREMOVEXATTR, + FUSE_FOP (state, fuse_removexattr_cbk, GF_FOP_FREMOVEXATTR, fremovexattr, state->fd, state->name, state->xdata); } else { gf_log ("glusterfs-fuse", GF_LOG_TRACE, "%"PRIu64": REMOVEXATTR %s/%"PRIu64" (%s)", state->finh->unique, state->loc.path, state->finh->nodeid, state->name); - FUSE_FOP (state, fuse_err_cbk, GF_FOP_REMOVEXATTR, + FUSE_FOP (state, fuse_removexattr_cbk, GF_FOP_REMOVEXATTR, removexattr, &state->loc, state->name, state->xdata); } } -- cgit