summaryrefslogtreecommitdiff
path: root/verify.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-07-23 16:11:43 +0200
committerJens Axboe <axboe@fb.com>2014-07-23 16:11:43 +0200
commitf8b0bd103ba18def828a0eab5611484486eed566 (patch)
treefb1e5e7d06d7e9ad7f69f5d2a68d966032e01c20 /verify.h
parent7ffa8930764e6ccc5bf036fe4d73f1d7276453e5 (diff)
downloadfio-f8b0bd103ba18def828a0eab5611484486eed566.tar.gz
fio-f8b0bd103ba18def828a0eab5611484486eed566.tar.bz2
verify: fix a bug with verify_async
There's a race between marking an io_u as deferred, completing it, and checking of that flag. It cannot be done reliably for async verify threads. So change the mechanism to have the verify_async part pull the io_u completely, so we don't have to check for a flag in it after we have run ->end_io(). This fixes a bug with verify_async, where fio would crash with this message: fio: io_u.c:1315: __get_io_u: Assertion `io_u->flags & IO_U_F_FREE' failed This race has always existed, but was made considerably worse with this commit: commit 2ae0b204743d6b4048c6fffd46c6280a70f2ecd1 Author: Jens Axboe <axboe@kernel.dk> Date: Tue May 28 14:16:55 2013 +0200 Replace list based free/busy/requeue list with FIFO + ring Cache friendliness of the list is pretty low. This has provably lower overhead. since we moved from a single list holding the io, to a separate verify list and io_u queues. The above bug is happening because the io_u ends up on both the freelist and the pending verify list, causing mayhem. Reported-by: scameron@beardog.cce.hp.com Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'verify.h')
-rw-r--r--verify.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/verify.h b/verify.h
index dba7743a..bb3fd492 100644
--- a/verify.h
+++ b/verify.h
@@ -76,8 +76,8 @@ struct vhdr_xxhash {
*/
extern void populate_verify_io_u(struct thread_data *, struct io_u *);
extern int __must_check get_next_verify(struct thread_data *td, struct io_u *);
-extern int __must_check verify_io_u(struct thread_data *, struct io_u *);
-extern int verify_io_u_async(struct thread_data *, struct io_u *);
+extern int __must_check verify_io_u(struct thread_data *, struct io_u **);
+extern int verify_io_u_async(struct thread_data *, struct io_u **);
extern void fill_verify_pattern(struct thread_data *td, void *p, unsigned int len, struct io_u *io_u, unsigned long seed, int use_seed);
extern void fill_buffer_pattern(struct thread_data *td, void *p, unsigned int len);
extern void fio_verify_init(struct thread_data *td);