diff options
| author | Pranith Kumar K <pkarampu@redhat.com> | 2016-11-12 16:47:00 +0530 | 
|---|---|---|
| committer | Raghavendra Talur <rtalur@redhat.com> | 2016-12-13 23:49:25 -0800 | 
| commit | 114537a2e11b3811dbf4f1ca0d4fd74d0c0b23c3 (patch) | |
| tree | 6576ef7738ade46b3749769f6679608e58fd909b /libglusterfs | |
| parent | 4b52890f52978231e0ccbcc2a4461683c7ca4b78 (diff) | |
protocol/server: Print error-xlator name
Problem:
At the moment from which xlator the errors are stemming from is a mystery.
Fix:
With this patch we can find on the server side which xlator first gave
the errno received by server xlator. I am not yet sure how to get this
done for client side which has lot of copy_frame()s. May be another
patch.
 >Change-Id: Ie13307b965facf2a496123e81ce0bd6756f98ac9
 >BUG: 1394548
 >Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
 >Reviewed-on: http://review.gluster.org/15836
 >Smoke: Gluster Build System <jenkins@build.gluster.org>
 >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
 >Reviewed-by: Vijay Bellur <vbellur@redhat.com>
 >CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
BUG: 1396780
Change-Id: I3b293d21528da391eafd0fbaa5b451a1d3ddc237
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/15886
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Diffstat (limited to 'libglusterfs')
| -rw-r--r-- | libglusterfs/src/stack.h | 22 | 
1 files changed, 22 insertions, 0 deletions
diff --git a/libglusterfs/src/stack.h b/libglusterfs/src/stack.h index 393fdac8e73..8a7a42a171d 100644 --- a/libglusterfs/src/stack.h +++ b/libglusterfs/src/stack.h @@ -36,6 +36,10 @@ typedef struct call_pool call_pool_t;  #define NFS_PID 1  #define LOW_PRIO_PROC_PID -1 + +#define STACK_ERR_XL_NAME(stack) (stack->err_xl?stack->err_xl->name:"-") +#define STACK_CLIENT_NAME(stack) (stack->client?stack->client->client_uid:"-") +  typedef int32_t (*ret_fn_t) (call_frame_t *frame,                               call_frame_t *prev_frame,                               xlator_t *this, @@ -110,6 +114,8 @@ struct _call_stack_t {          int32_t                       op;          int8_t                        type;          struct timeval                tv; +        xlator_t                     *err_xl; +        int32_t                       error;  }; @@ -363,6 +369,14 @@ STACK_RESET (call_stack_t *stack)                  LOCK(&frame->root->stack_lock);                         \                  {                                                       \                          _parent->ref_count--;                           \ +                        if (op_ret < 0 &&                               \ +                            op_errno != frame->root->error) {           \ +                                frame->root->err_xl = frame->this;      \ +                                frame->root->error = op_errno;          \ +                        } else if (op_ret == 0) {                       \ +                                frame->root->err_xl = NULL;             \ +                                frame->root->error = 0;                 \ +                        }                                               \                  }                                                       \                  UNLOCK(&frame->root->stack_lock);                       \                  old_THIS = THIS;                                        \ @@ -408,6 +422,14 @@ STACK_RESET (call_stack_t *stack)                  LOCK(&frame->root->stack_lock);                         \                  {                                                       \                          _parent->ref_count--;                           \ +                        if (op_ret < 0 &&                               \ +                            op_errno != frame->root->error) {           \ +                                frame->root->err_xl = frame->this;      \ +                                frame->root->error = op_errno;          \ +                        } else if (op_ret == 0) {                       \ +                                frame->root->err_xl = NULL;             \ +                                frame->root->error = 0;                 \ +                        }                                               \                  }                                                       \                  UNLOCK(&frame->root->stack_lock);                       \                  old_THIS = THIS;                                        \  | 
