From b72b090a097c8ee2711c8fb065d250ed68dcd0bf Mon Sep 17 00:00:00 2001 From: trinity-1686a Date: Sat, 21 Feb 2026 07:21:24 +0000 Subject: [PATCH] fix silent write errors (#1358) fix #1355 some write errors are not reported when calling write_all. That's notably the case of ENOSPC on small buffers (1MiB). on ext4, the error is catched when calling flush(). This is hopefully the case on most local filesystems, though afaik this assumption doesn't hold for NFS Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1358 Co-authored-by: trinity-1686a Co-committed-by: trinity-1686a --- src/block/manager.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/block/manager.rs b/src/block/manager.rs index 06cf9cbe..96ca9c90 100644 --- a/src/block/manager.rs +++ b/src/block/manager.rs @@ -783,6 +783,7 @@ impl BlockManagerLocked { let mut f = fs::File::create(&path_tmp).await?; f.write_all(data).await?; + f.flush().await?; mgr.metrics.bytes_written.add(data.len() as u64); if mgr.data_fsync {