summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/iobuf.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libglusterfs/src/iobuf.c b/libglusterfs/src/iobuf.c
index 7da029bd1a0..a233387fcfe 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) {