From 0281283ee0e27b26c2f30f0434a23a4269e147cf Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 2 Sep 2009 04:53:42 +0000 Subject: performance/write-behind: communicate back the errors in writes to servers in the next immediate writes from application. Signed-off-by: Anand V. Avati 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 --- xlators/performance/write-behind/src/write-behind.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'xlators/performance/write-behind/src') diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index 569450a9f9c..89611de1c60 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -1426,6 +1426,7 @@ wb_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, uint64_t tmp_file = 0; call_stub_t *stub = NULL; wb_local_t *local = NULL; + int32_t op_ret = 0, op_errno = 0; if (vector != NULL) size = iov_length (vector, count); @@ -1449,7 +1450,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 { @@ -1460,6 +1466,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), -- cgit