|
|
3604df |
From 1b82cb88124b5ff753a2f551956b337a66265ec7 Mon Sep 17 00:00:00 2001
|
|
|
3604df |
From: Raghavendra G <rgowdapp@redhat.com>
|
|
|
3604df |
Date: Fri, 20 Jan 2017 16:09:13 +0530
|
|
|
3604df |
Subject: [PATCH 282/285] performance/write-behind: access stub only if
|
|
|
3604df |
available during statedump
|
|
|
3604df |
|
|
|
3604df |
>Reviewed-on: https://review.gluster.org/16440
|
|
|
3604df |
>Reviewed-by: N Balachandran <nbalacha@redhat.com>
|
|
|
3604df |
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
|
|
3604df |
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
|
|
3604df |
>Smoke: Gluster Build System <jenkins@build.gluster.org>
|
|
|
3604df |
|
|
|
3604df |
Change-Id: Ia5dd718458a5e32138012f81f014d13fc6b28be2
|
|
|
3604df |
BUG: 1414247
|
|
|
3604df |
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
|
|
|
3604df |
Reviewed-on: https://code.engineering.redhat.com/gerrit/96726
|
|
|
3604df |
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
3604df |
Tested-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
3604df |
---
|
|
|
3604df |
libglusterfs/src/call-stub.c | 47 ++++++++++++++++++++++
|
|
|
3604df |
libglusterfs/src/call-stub.h | 2 +
|
|
|
3604df |
.../performance/write-behind/src/write-behind.c | 24 +++++------
|
|
|
3604df |
3 files changed, 61 insertions(+), 12 deletions(-)
|
|
|
3604df |
|
|
|
3604df |
diff --git a/libglusterfs/src/call-stub.c b/libglusterfs/src/call-stub.c
|
|
|
3604df |
index 9ed2493..c9c47b5 100644
|
|
|
3604df |
--- a/libglusterfs/src/call-stub.c
|
|
|
3604df |
+++ b/libglusterfs/src/call-stub.c
|
|
|
3604df |
@@ -2538,3 +2538,50 @@ call_unwind_error (call_stub_t *stub, int op_ret, int op_errno)
|
|
|
3604df |
return;
|
|
|
3604df |
|
|
|
3604df |
}
|
|
|
3604df |
+
|
|
|
3604df |
+
|
|
|
3604df |
+void
|
|
|
3604df |
+call_unwind_error_keep_stub (call_stub_t *stub, int op_ret, int op_errno)
|
|
|
3604df |
+{
|
|
|
3604df |
+ xlator_t *old_THIS = NULL;
|
|
|
3604df |
+
|
|
|
3604df |
+ list_del_init (&stub->list);
|
|
|
3604df |
+
|
|
|
3604df |
+ old_THIS = THIS;
|
|
|
3604df |
+ THIS = stub->frame->this;
|
|
|
3604df |
+ {
|
|
|
3604df |
+ stub->args_cbk.op_ret = op_ret;
|
|
|
3604df |
+ stub->args_cbk.op_errno = op_errno;
|
|
|
3604df |
+ call_resume_unwind (stub);
|
|
|
3604df |
+ }
|
|
|
3604df |
+
|
|
|
3604df |
+ THIS = old_THIS;
|
|
|
3604df |
+
|
|
|
3604df |
+ return;
|
|
|
3604df |
+
|
|
|
3604df |
+}
|
|
|
3604df |
+
|
|
|
3604df |
+void
|
|
|
3604df |
+call_resume_keep_stub (call_stub_t *stub)
|
|
|
3604df |
+{
|
|
|
3604df |
+ xlator_t *old_THIS = NULL;
|
|
|
3604df |
+
|
|
|
3604df |
+ errno = EINVAL;
|
|
|
3604df |
+ GF_VALIDATE_OR_GOTO ("call-stub", stub, out);
|
|
|
3604df |
+
|
|
|
3604df |
+ list_del_init (&stub->list);
|
|
|
3604df |
+
|
|
|
3604df |
+ old_THIS = THIS;
|
|
|
3604df |
+ THIS = stub->frame->this;
|
|
|
3604df |
+ {
|
|
|
3604df |
+ if (stub->wind)
|
|
|
3604df |
+ call_resume_wind (stub);
|
|
|
3604df |
+ else
|
|
|
3604df |
+ call_resume_unwind (stub);
|
|
|
3604df |
+ }
|
|
|
3604df |
+
|
|
|
3604df |
+ THIS = old_THIS;
|
|
|
3604df |
+
|
|
|
3604df |
+out:
|
|
|
3604df |
+ return;
|
|
|
3604df |
+}
|
|
|
3604df |
diff --git a/libglusterfs/src/call-stub.h b/libglusterfs/src/call-stub.h
|
|
|
3604df |
index 5779ee3..300b593 100644
|
|
|
3604df |
--- a/libglusterfs/src/call-stub.h
|
|
|
3604df |
+++ b/libglusterfs/src/call-stub.h
|
|
|
3604df |
@@ -763,8 +763,10 @@ fop_setactivelk_cbk_stub (call_frame_t *frame, fop_setactivelk_cbk_t fn,
|
|
|
3604df |
int32_t op_ret, int32_t op_errno, dict_t *xdata);
|
|
|
3604df |
|
|
|
3604df |
void call_resume (call_stub_t *stub);
|
|
|
3604df |
+void call_resume_keep_stub (call_stub_t *stub);
|
|
|
3604df |
void call_stub_destroy (call_stub_t *stub);
|
|
|
3604df |
void call_unwind_error (call_stub_t *stub, int op_ret, int op_errno);
|
|
|
3604df |
+void call_unwind_error_keep_stub (call_stub_t *stub, int op_ret, int op_errno);
|
|
|
3604df |
|
|
|
3604df |
/*
|
|
|
3604df |
* Sometimes we might want to call just this, perhaps repeatedly, without
|
|
|
3604df |
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
|
|
|
3604df |
index 7f5719b..ea3b987 100644
|
|
|
3604df |
--- a/xlators/performance/write-behind/src/write-behind.c
|
|
|
3604df |
+++ b/xlators/performance/write-behind/src/write-behind.c
|
|
|
3604df |
@@ -373,10 +373,10 @@ __wb_request_unref (wb_request_t *req)
|
|
|
3604df |
list_del_init (&req->winds);
|
|
|
3604df |
list_del_init (&req->unwinds);
|
|
|
3604df |
|
|
|
3604df |
- if (req->stub && req->ordering.tempted) {
|
|
|
3604df |
+ if (req->stub) {
|
|
|
3604df |
call_stub_destroy (req->stub);
|
|
|
3604df |
req->stub = NULL;
|
|
|
3604df |
- } /* else we would have call_resume()'ed */
|
|
|
3604df |
+ }
|
|
|
3604df |
|
|
|
3604df |
if (req->iobref)
|
|
|
3604df |
iobref_unref (req->iobref);
|
|
|
3604df |
@@ -1511,21 +1511,20 @@ __wb_pick_winds (wb_inode_t *wb_inode, list_head_t *tasks,
|
|
|
3604df |
void
|
|
|
3604df |
wb_do_winds (wb_inode_t *wb_inode, list_head_t *tasks)
|
|
|
3604df |
{
|
|
|
3604df |
- wb_request_t *req = NULL;
|
|
|
3604df |
- wb_request_t *tmp = NULL;
|
|
|
3604df |
+ wb_request_t *req = NULL;
|
|
|
3604df |
+ wb_request_t *tmp = NULL;
|
|
|
3604df |
|
|
|
3604df |
list_for_each_entry_safe (req, tmp, tasks, winds) {
|
|
|
3604df |
- list_del_init (&req->winds);
|
|
|
3604df |
+ list_del_init (&req->winds);
|
|
|
3604df |
|
|
|
3604df |
if (req->op_ret == -1) {
|
|
|
3604df |
- call_unwind_error (req->stub, req->op_ret,
|
|
|
3604df |
- req->op_errno);
|
|
|
3604df |
+ call_unwind_error_keep_stub (req->stub, req->op_ret,
|
|
|
3604df |
+ req->op_errno);
|
|
|
3604df |
} else {
|
|
|
3604df |
- call_resume (req->stub);
|
|
|
3604df |
+ call_resume_keep_stub (req->stub);
|
|
|
3604df |
}
|
|
|
3604df |
|
|
|
3604df |
- req->stub = NULL;
|
|
|
3604df |
- wb_request_unref (req);
|
|
|
3604df |
+ wb_request_unref (req);
|
|
|
3604df |
}
|
|
|
3604df |
}
|
|
|
3604df |
|
|
|
3604df |
@@ -2352,8 +2351,9 @@ __wb_dump_requests (struct list_head *head, char *prefix)
|
|
|
3604df |
gf_proc_dump_write ("size", "%"GF_PRI_SIZET,
|
|
|
3604df |
req->write_size);
|
|
|
3604df |
|
|
|
3604df |
- gf_proc_dump_write ("offset", "%"PRId64,
|
|
|
3604df |
- req->stub->args.offset);
|
|
|
3604df |
+ if (req->stub)
|
|
|
3604df |
+ gf_proc_dump_write ("offset", "%"PRId64,
|
|
|
3604df |
+ req->stub->args.offset);
|
|
|
3604df |
|
|
|
3604df |
flag = req->ordering.lied;
|
|
|
3604df |
gf_proc_dump_write ("lied", "%d", flag);
|
|
|
3604df |
--
|
|
|
3604df |
2.9.3
|
|
|
3604df |
|