From: Jens Axboe Date: Fri, 22 Mar 2013 21:23:20 +0000 (-0600) Subject: posixaio: restart suspend list after we have used aio_suspend() X-Git-Tag: fio-2.0.15~16 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=f832642400a7d0f19f21b744d1b1c7dad452408a 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 --- 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;