From f832642400a7d0f19f21b744d1b1c7dad452408a Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 22 Mar 2013 15:23:20 -0600 Subject: [PATCH] posixaio: restart suspend list after we have used aio_suspend() Otherwise we could both end up putting entries in there twice, if there are still in flight, or having done entries in there too. So restart the suspend list after aio_suspend(), so we only put truly still-pending ios in there. Signed-off-by: Jens Axboe --- engines/posixaio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engines/posixaio.c b/engines/posixaio.c index a943e5bb..1858e520 100644 --- a/engines/posixaio.c +++ b/engines/posixaio.c @@ -98,7 +98,7 @@ static int fio_posixaio_getevents(struct thread_data *td, unsigned int min, struct flist_head *entry; struct timespec start; int have_timeout = 0; - int suspend_entries = 0; + int suspend_entries; unsigned int r; if (t && !fill_timespec(&start)) @@ -107,8 +107,9 @@ static int fio_posixaio_getevents(struct thread_data *td, unsigned int min, memset(&start, 0, sizeof(start)); r = 0; - memset(suspend_list, 0, sizeof(*suspend_list)); restart: + memset(suspend_list, 0, sizeof(*suspend_list)); + suspend_entries = 0; flist_for_each(entry, &td->io_u_busylist) { struct io_u *io_u = flist_entry(entry, struct io_u, list); int err; -- 2.25.1