posixaio: restart suspend list after we have used aio_suspend()
authorJens Axboe <axboe@kernel.dk>
Fri, 22 Mar 2013 21:23:20 +0000 (15:23 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 22 Mar 2013 21:23:20 +0000 (15:23 -0600)
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 <axboe@kernel.dk>
engines/posixaio.c

index a943e5bbf6eaad2c953d21f5c9abd431690fdabf..1858e5202457eecd4c707cff7fd78f35bf1dfc34 100644 (file)
@@ -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;