summaryrefslogtreecommitdiffstats
path: root/xlators/performance/stat-prefetch
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-12-01 18:05:15 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-12-01 18:28:07 -0800
commit6b2ad4a77fe8022b66cde091c3ebfb828dcf93da (patch)
tree2c0fac96d715e74d3eb594c68e4deffb1a4c01dc /xlators/performance/stat-prefetch
parenta60647a995357c8e573d05e15e17c68c6e3e38bb (diff)
stat-prefetch: fix unsafe reference to @local in sp_lookup_cbk.
Signed-off-by: Raghavendra G <raghavendra@gluster.com> 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/stat-prefetch')
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index 9d799ef6a..6c81e8a3c 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -660,6 +660,7 @@ sp_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
call_stub_t *stub = NULL, *tmp = NULL;
sp_local_t *local = NULL;
sp_cache_t *cache = NULL;
+ char need_unwind = 0;
INIT_LIST_HEAD (&waiting_ops);
@@ -678,9 +679,13 @@ sp_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
}
+ if (local && local->is_lookup) {
+ need_unwind = 1;
+ }
+
ret = inode_ctx_get (inode, this, &value);
if (ret == 0) {
- inode_ctx = (sp_inode_ctx_t *)(long)value;
+ inode_ctx = (sp_inode_ctx_t *)(long)value;
if (inode_ctx == NULL) {
op_ret = -1;
op_errno = EINVAL;
@@ -705,7 +710,7 @@ sp_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
out:
- if ((local != NULL) && (local->is_lookup)) {
+ if (need_unwind) {
SP_STACK_UNWIND (frame, op_ret, op_errno, inode, buf, dict);
}