summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-cache
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2013-04-24 18:05:13 +0530
committerVijay Bellur <vbellur@redhat.com>2013-04-26 00:18:54 -0700
commit6419bd804b9cf43ad08fc54ef605c77b0e7895af (patch)
tree37762ea6fbd2a79de4eb0102f8a6ccd206d5bf9e /xlators/performance/io-cache
parent054c1d7eb3782c35fc0f0ea3a5fd25337d080294 (diff)
performance/io-cache: Avoid double mem_put in ioc_readv
On readv error io-cache frame->local is not set to NULL so the local is mem_put in STACK_DESTROY as well. This patch sets frame->local to NULL in all cases. Change-Id: I00013df1377475aa5f3c0c681dcb58b32e1e8063 BUG: 955751 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/4884 Reviewed-by: Raghavendra G <raghavendra@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/performance/io-cache')
-rw-r--r--xlators/performance/io-cache/src/page.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/performance/io-cache/src/page.c b/xlators/performance/io-cache/src/page.c
index 54c6f9b5019..b2e20ba659f 100644
--- a/xlators/performance/io-cache/src/page.c
+++ b/xlators/performance/io-cache/src/page.c
@@ -824,7 +824,6 @@ ioc_frame_unwind (call_frame_t *frame)
}
// ioc_local_lock (local);
- frame->local = NULL;
iobref = iobref_new ();
if (iobref == NULL) {
op_ret = -1;
@@ -875,6 +874,7 @@ unwind:
// ioc_local_unlock (local);
+ frame->local = NULL;
STACK_UNWIND_STRICT (readv, frame, op_ret, op_errno, vector,
count, &stbuf, iobref, NULL);
@@ -888,7 +888,8 @@ unwind:
}
pthread_mutex_destroy (&local->local_lock);
- mem_put (local);
+ if (local)
+ mem_put (local);
return;
}