summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-12-02 01:52:15 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-12-02 10:59:56 -0800
commitb37c742f579191a96737c519f6de1ff54a3076d7 (patch)
tree3e6ece932d3f9aeee1459f651e81215854c78f66
parent570e5b5a378f8c94c9b96f806ce8ae2c0fa11b22 (diff)
performance/stat-prefetch: fix errors in handling memory allocation failures in sp_inode_ctx_process.
- the variables that are used for making decisions are assigned before memory allocations and these variables were not reset to correct values in case of memory allocation failures. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 257 (Backport stat-prefetch to 2.0) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=257
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index 11821eb8aad..b4e6b379c83 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -108,9 +108,6 @@ sp_process_inode_ctx (call_frame_t *frame, xlator_t *this, loc_t *loc,
}
if (!(inode_ctx->looked_up || inode_ctx->lookup_in_progress)) {
- *need_lookup = 1;
- inode_ctx->lookup_in_progress = 1;
-
if (frame->local == NULL) {
local = CALLOC (1, sizeof (*local));
GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name,
@@ -129,6 +126,9 @@ sp_process_inode_ctx (call_frame_t *frame, xlator_t *this, loc_t *loc,
goto unlock;
}
}
+
+ *need_lookup = 1;
+ inode_ctx->lookup_in_progress = 1;
}
if (inode_ctx->looked_up) {