From 0f797284e26b56c3832d4221c75b9704b198f944 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Tue, 7 Jul 2020 13:59:07 +0800 Subject: [PATCH] SdReader: fixed write cache bug. --- src/runtime/src/sd_reader.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/runtime/src/sd_reader.rs b/src/runtime/src/sd_reader.rs index 7bf55d04..245cba5b 100644 --- a/src/runtime/src/sd_reader.rs +++ b/src/runtime/src/sd_reader.rs @@ -237,6 +237,7 @@ impl Write for SdReader { let (a, b, c) = self.block_align(buf); self.write_unaligned(a)?; if b.len() > 0 { + self.flush()?; self.invalidate_buffer(); if let Err(_) = self.sd.write_block( self.byte_addr / BLOCK_SIZE as u32,