summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-09-02 04:54:23 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-08 04:47:37 -0700
commitbdec7d133963bb94528bfbf5c47dd1eb08bf4b35 (patch)
tree48cebb857ada8f1418dca3f852c8c388303f950c /xlators/performance
parentc7f757aea81e65980c68b4293836097ce595b5b3 (diff)
performance/write-behind: communicate back the errors in writes to servers, in the next immediate writes from application.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 242 (If any of the writes fail, write-behind should not wait till the fd is closed for reporting errors) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=242
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/write-behind/src/write-behind.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index ae1792e07e1..83ff8d220b7 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -1659,6 +1659,7 @@ wb_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector,
wb_local_t *local = NULL;
wb_request_t *request = NULL;
int32_t ret = -1;
+ int32_t op_ret = -1, op_errno = -1;
if (vector != NULL)
size = iov_length (vector, count);
@@ -1682,7 +1683,12 @@ wb_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector,
LOCK (&file->lock);
{
- if (file->disabled || file->disable_till) {
+ op_ret = file->op_ret;
+ op_errno = file->op_errno;
+
+ file->op_ret = 0;
+
+ if ((op_ret == 0) && (file->disabled || file->disable_till)) {
if (size > file->disable_till) {
file->disable_till = 0;
} else {
@@ -1693,6 +1699,11 @@ wb_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector,
}
UNLOCK (&file->lock);
+ if (op_ret == -1) {
+ STACK_UNWIND (frame, op_ret, op_errno, NULL);
+ return 0;
+ }
+
if (wb_disabled) {
STACK_WIND (frame, wb_writev_cbk,
FIRST_CHILD (frame->this),