diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-12-02 12:29:56 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-12-02 10:29:30 -0800 |
commit | 14c5492a2c03728f18a20125b785f43f441dbfd5 (patch) | |
tree | 726a757ac85d377612f0fead31deb783a3a9fa5d /xlators/performance/stat-prefetch/src/stat-prefetch.c | |
parent | 855a57a1f9c05d627c22f3091a7e0603d3e4092f (diff) |
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 <raghavendra@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 426 (stat on mount point hangs.)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=426
Diffstat (limited to 'xlators/performance/stat-prefetch/src/stat-prefetch.c')
-rw-r--r-- | xlators/performance/stat-prefetch/src/stat-prefetch.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index da398d23a0f..bb601e6a103 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -585,7 +585,12 @@ 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); @@ -596,12 +601,12 @@ 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; + inode_ctx = (sp_inode_ctx_t *)(long)value; if (inode_ctx == NULL) { op_ret = -1; op_errno = EINVAL; |