From 0f73d6c94ce00eae317463fe32de40bb4225c820 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Thu, 3 Dec 2009 03:16:34 +0000 Subject: performance/stat-prefetch: don't access stat if lookup has been failed. Signed-off-by: Raghavendra G Signed-off-by: Anand V. Avati BUG: 429 (crash in lookup_cbk when lookup returns with error) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=429 --- xlators/performance/stat-prefetch/src/stat-prefetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index bb601e6a..93e153a3 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)); } -- cgit