Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rolled back the change (don't always read before writing) to fat_writ…
…e.c in 1c19a3 (05/09/2014). There have been a couple of cases where data does not seem to get written properly to the USB device, which I once traced to this commit. I suspect that it is due to the design of scache because it has no way of knowing whether a block has sectors that are in use or not. As scache caches sectors in blocks of 4096 bytes, isn't it possible for a block in the cache to cross between multiple clusters because a partition may not be aligned to 4096-byte boundaries? If fat_WriteFile deems that a sector would be entirely replaced, the cache would mark the 4096 bytes that the sector belongs to as "allocated" but will not read in any of its sectors. If there are sectors within that block that should retain their content, that content is lost.
- Loading branch information