From fbec4a070d74cb17ea1d47005e8e5aaa13c53390 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Wed, 3 Aug 2022 18:30:36 -0700 Subject: [PATCH] fuzz: block: Ensure the virtio-block thread is killed and joined This also ensures that the 'queue_evt' is fully processed, as we enforce the main thread is waiting for the virtio-block thread to process the 'kill_evt' which is after the 'queue_evt' processing. Signed-off-by: Bo Chen --- fuzz/fuzz_targets/block.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fuzz/fuzz_targets/block.rs b/fuzz/fuzz_targets/block.rs index 5df66fdd0..7c5d73574 100644 --- a/fuzz/fuzz_targets/block.rs +++ b/fuzz/fuzz_targets/block.rs @@ -114,6 +114,8 @@ fuzz_target!(|bytes| { queue_evt.write(77).unwrap(); // Rings the doorbell, any byte will do. wait_queue_event_processed(queue_evt); + + block.reset(); // Ensure the virtio-block device thread is killed and joined }); fn read_u64(readable: &mut T) -> u64 {