summaryrefslogtreecommitdiffstats
path: root/xlators/performance/stat-prefetch/src/stat-prefetch.c
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-12-03 03:16:34 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-12-03 02:00:54 -0800
commit0f73d6c94ce00eae317463fe32de40bb4225c820 (patch)
tree107d083459665435f81fa02a8ef1348254ade079 /xlators/performance/stat-prefetch/src/stat-prefetch.c
parentd666c882cf6896fb700a15bd72e53c675356f8fc (diff)
performance/stat-prefetch: don't access stat if lookup has been failed.
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 429 (crash in lookup_cbk when lookup returns with error) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=429
Diffstat (limited to 'xlators/performance/stat-prefetch/src/stat-prefetch.c')
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index bb601e6a1..93e153a32 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -619,7 +619,7 @@ sp_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
inode_ctx->op_errno = op_errno;
inode_ctx->looked_up = 1;
inode_ctx->lookup_in_progress = 0;
- if (S_ISDIR (buf->st_mode) && (op_ret == 0)) {
+ if ((op_ret == 0) && S_ISDIR (buf->st_mode)) {
memcpy (&inode_ctx->stbuf, buf,
sizeof (*buf));
}