diff options
| author | Vijay Bellur <vbellur@redhat.com> | 2015-08-26 15:24:39 +0530 | 
|---|---|---|
| committer | Raghavendra Bhat <raghavendra@redhat.com> | 2015-08-28 05:33:40 -0700 | 
| commit | bd9dd34700de63f96b9fc65125d539b2c16fa6bf (patch) | |
| tree | f0f3530d46bd21b539863128e55a3f3e25b909b7 /xlators/mount | |
| parent | 7a27810aecce6e014100dbbc3c7961d769082c1e (diff) | |
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: 1257110
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/12015
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/mount')
| -rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 45 | 
1 files changed, 43 insertions, 2 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index d6edcb360cd..12d1104d14a 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -1205,6 +1205,47 @@ fuse_setattr (xlator_t *this, fuse_in_header_t *finh, void *msg)  }  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);          }  }  | 
