diff options
author | Raghavendra G <raghavendra@gluster.com> | 2012-11-16 12:06:36 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-01-29 11:01:34 -0800 |
commit | 088050b257ac9cbd2115587b0f7306760c44a4a3 (patch) | |
tree | 74e1070291e6d2baecafad66af35d337abe79808 /xlators/performance/io-cache/src | |
parent | f811441e257cafb975dfcd16f14b4378beee524e (diff) |
performance/io-cache: propagate errors while unwinding frame in
read path.
Change-Id: Ieb5d592a987e8681d5ec019da309f75e3b207580
BUG: 858242
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.org/4204
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/performance/io-cache/src')
-rw-r--r-- | xlators/performance/io-cache/src/page.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/xlators/performance/io-cache/src/page.c b/xlators/performance/io-cache/src/page.c index c18c04a0bdb..54c6f9b5019 100644 --- a/xlators/performance/io-cache/src/page.c +++ b/xlators/performance/io-cache/src/page.c @@ -804,7 +804,7 @@ ioc_frame_unwind (call_frame_t *frame) int32_t copied = 0; struct iobref *iobref = NULL; struct iatt stbuf = {0,}; - int32_t op_ret = 0; + int32_t op_ret = 0, op_errno = 0; GF_ASSERT (frame); @@ -813,7 +813,13 @@ ioc_frame_unwind (call_frame_t *frame) gf_log (frame->this->name, GF_LOG_WARNING, "local is NULL"); op_ret = -1; - local->op_errno = ENOMEM; + op_errno = ENOMEM; + goto unwind; + } + + if (local->op_ret < 0) { + op_ret = local->op_ret; + op_errno = local->op_errno; goto unwind; } @@ -822,7 +828,7 @@ ioc_frame_unwind (call_frame_t *frame) iobref = iobref_new (); if (iobref == NULL) { op_ret = -1; - local->op_errno = ENOMEM; + op_errno = ENOMEM; } if (list_empty (&local->fill_list)) { @@ -839,7 +845,7 @@ ioc_frame_unwind (call_frame_t *frame) vector = GF_CALLOC (count, sizeof (*vector), gf_ioc_mt_iovec); if (vector == NULL) { op_ret = -1; - local->op_errno = ENOMEM; + op_errno = ENOMEM; } list_for_each_entry_safe (fill, next, &local->fill_list, list) { @@ -869,7 +875,7 @@ unwind: // ioc_local_unlock (local); - STACK_UNWIND_STRICT (readv, frame, op_ret, local->op_errno, vector, + STACK_UNWIND_STRICT (readv, frame, op_ret, op_errno, vector, count, &stbuf, iobref, NULL); if (iobref != NULL) { |