From 496ff502e2b00b37051c1319885ff495475196fc Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 2 Dec 2009 12:19:07 +0000 Subject: performance/stat-prefetch: get inode context from local->loc.inode instead of inode passed as arguement in sp_lookup_cbk. - @inode in sp_lookup_cbk may be NULL in case of failure of lookup. Signed-off-by: Raghavendra G Signed-off-by: Anand V. Avati BUG: 426 (stat on mount point hangs.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=426 --- xlators/performance/stat-prefetch/src/stat-prefetch.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'xlators') diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index a9934bb15..6ac77dd8c 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -693,7 +693,13 @@ sp_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (local == NULL) { op_ret = -1; op_errno = EINVAL; - } else if (op_ret == -1) { + gf_log (this->name, GF_LOG_DEBUG, "local is NULL, but it is " + "needed to find and resume operations waiting on " + "lookup"); + goto out; + } + + if (op_ret == -1) { cache = sp_get_cache_inode (this, local->loc.parent, frame->root->pid); @@ -704,11 +710,11 @@ sp_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } } - if (local && local->is_lookup) { + if (local->is_lookup) { need_unwind = 1; } - ret = inode_ctx_get (inode, this, &value); + ret = inode_ctx_get (local->loc.inode, this, &value); if (ret == 0) { inode_ctx = (sp_inode_ctx_t *)(long)value; if (inode_ctx == NULL) { -- cgit