summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorvinayak hegde <vinayak@gluster.com>2009-10-16 00:38:25 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-16 03:18:04 -0700
commit61b5516701224073bbf71afea93ce58d5bd6b811 (patch)
tree34693f2ac074a5f2ea7167199da1980846625933 /xlators/performance
parent6fda29fcd64dffbbfdbbf63eed69a557e46598d0 (diff)
performance/write-behind: initialize frame->local before goto out label
if mtime,atime are not changed, frame->local will not be initialized. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 310 (While trying to create a file on replicate with write behind set-up, client crashes.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=310
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/write-behind/src/write-behind.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index cd38f00b394..71eb115435d 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -1127,6 +1127,16 @@ wb_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
wb_request_t *request = NULL;
int32_t ret = -1, op_errno = EINVAL;
+ local = CALLOC (1, sizeof (*local));
+ if (local == NULL) {
+ op_errno = ENOMEM;
+ goto unwind;
+ }
+
+ local->file = file;
+
+ frame->local = local;
+
if (!(valid & (GF_SET_ATTR_ATIME | GF_SET_ATTR_MTIME))) {
STACK_WIND (frame,
wb_setattr_cbk,
@@ -1152,16 +1162,6 @@ wb_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
}
- local = CALLOC (1, sizeof (*local));
- if (local == NULL) {
- op_errno = ENOMEM;
- goto unwind;
- }
-
- local->file = file;
-
- frame->local = local;
-
if (file) {
stub = fop_setattr_stub (frame, wb_setattr_helper, loc, stbuf, valid);
if (stub == NULL) {