From 61de5195f5500a020540d0fb49cd1a2434b2dd1c Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 5 Mar 2024 19:04:09 -0500 Subject: [PATCH] blockdev: Use --direct-io=on for losetup This is what other projects do; it avoids double buffering and is generally a good idea. Signed-off-by: Colin Walters --- lib/src/blockdev.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/blockdev.rs b/lib/src/blockdev.rs index a984a032..f6683e3e 100644 --- a/lib/src/blockdev.rs +++ b/lib/src/blockdev.rs @@ -84,7 +84,7 @@ impl LoopbackDevice { // Create a new loopback block device targeting the provided file path. pub(crate) fn new(path: &Path) -> Result { let dev = Task::new("losetup", "losetup") - .args(["--show", "-P", "--find"]) + .args(["--show", "--direct-io=on", "-P", "--find"]) .arg(path) .quiet() .read()?;