From b9a210a419ff28f2d75b10a680520fd6cc37ac5a Mon Sep 17 00:00:00 2001 From: "Anand V. Avati" Date: Mon, 13 Apr 2009 14:03:21 +0530 Subject: bug fix in iobuf_select_arena - never created a new arena Signed-off-by: Anand V. Avati --- libglusterfs/src/iobuf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libglusterfs/src/iobuf.c') diff --git a/libglusterfs/src/iobuf.c b/libglusterfs/src/iobuf.c index 7da029bd1..a233387fc 100644 --- a/libglusterfs/src/iobuf.c +++ b/libglusterfs/src/iobuf.c @@ -245,11 +245,14 @@ struct iobuf_arena * __iobuf_select_arena (struct iobuf_pool *iobuf_pool) { struct iobuf_arena *iobuf_arena = NULL; + struct iobuf_arena *trav = NULL; /* look for unused iobuf from the head-most arena */ - list_for_each_entry (iobuf_arena, &iobuf_pool->arenas.list, list) { - if (iobuf_arena->passive_cnt) + list_for_each_entry (trav, &iobuf_pool->arenas.list, list) { + if (trav->passive_cnt) { + iobuf_arena = trav; break; + } } if (!iobuf_arena) { -- cgit