From 270621b34af7528755373e04b07f959c8dca274b Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sat, 21 Mar 2009 19:04:15 -0700 Subject: fixes crash in write-behind in wb_flush, there was a chance that wb_process_queue() was called with NULL frame, which causes crash. Signed-off-by: Anand V. Avati --- xlators/performance/write-behind/src/write-behind.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index c41bf3d58e0..a0568de39c9 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -393,7 +393,7 @@ wb_sync (call_frame_t *frame, wb_file_t *file, list_head_t *winds) list_del_init (&request->winds); list_add_tail (&request->winds, &local->winds); - if (!next + if ((!next) || ((count + next->stub->args.writev.count) > MAX_VECTOR_COUNT)) { sync_frame = copy_frame (frame); @@ -1649,12 +1649,12 @@ wb_flush (call_frame_t *frame, return 0; } + process_frame = copy_frame (frame); if (conf->flush_behind && (!file->disabled) && (file->disable_till == 0)) { tmp_local = CALLOC (1, sizeof (*local)); tmp_local->file = file; - process_frame = copy_frame (frame); process_frame->local = tmp_local; } @@ -1675,6 +1675,7 @@ wb_flush (call_frame_t *frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->flush, fd); + STACK_DESTROY (process_frame->root); } return 0; -- cgit