summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/stack.h
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2016-11-12 16:47:00 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-11-16 02:56:05 -0800
commit83311c5bb735508274bb25cc610e929481577f9b (patch)
treeb53a383bef9feef5ebf520e30b225caf4cd1ba49 /libglusterfs/src/stack.h
parentb5387f90f942bfc7cf0f7f969740f8bf1c911b80 (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>
Diffstat (limited to 'libglusterfs/src/stack.h')
-rw-r--r--libglusterfs/src/stack.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/libglusterfs/src/stack.h b/libglusterfs/src/stack.h
index 2899be9bf2f..d6d44d22396 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;
};
@@ -361,6 +367,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; \
@@ -406,6 +420,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; \