4 ms·
I didn't realise fsync syncs the whole fs. This explains some write cache issues I've been having writing real-time data streams to sometimes slow SD cards. Thi
by Badfood 6y ago
I didn't realise fsync syncs the whole fs. This explains some write cache issues I've been having writing real-time data streams to sometimes slow SD cards. This change would solve my problems rather than create problems. But hey now I can fix it anyway
- sbierwagen 6y agofsync is supposed to sync the entire filesystem, yes. On a SD card, I would expect it to do what it says it does. However, on regular hard drives, filesystem devs and hardware vendors are all incentivized to cheat, since io benchmarks are big and obvious, while dropping data on the floor with power loss or failing hardware is subtle and hard to notice. In practice, reliably syncing a file can be surprisingly hard: https://danluu.com/file-consistency/ https://danluu.com/file-consistency/