From b82307d8a5304e7b0900b28df2582f947e5790ee Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Fri, 21 Aug 2020 11:39:41 +0100 Subject: [PATCH] [thin_check (rust)] drop O_DIRECT for the sync_io engine. O_DIRECT slows us down, and there's no correctness reason for having it. --- src/io_engine.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/io_engine.rs b/src/io_engine.rs index 8f03671..22477e9 100644 --- a/src/io_engine.rs +++ b/src/io_engine.rs @@ -49,6 +49,10 @@ unsafe impl Send for Block {} pub trait IoEngine { fn get_nr_blocks(&self) -> u64; + + // FIXME: we need to indicate an error per block. Add error field + // to block? Data should not be accessible if a read failed. + // We should support retry for failed writes. fn read(&self, block: &mut Block) -> Result<()>; fn read_many(&self, blocks: &mut [Block]) -> Result<()>; fn write(&self, block: &Block) -> Result<()>; @@ -73,7 +77,6 @@ impl SyncIoEngine { let file = OpenOptions::new() .read(true) .write(writeable) - .custom_flags(libc::O_DIRECT) .open(path)?; Ok(file)