Re: Writing more than 4096 bytes with O_SYNC flag does not persist all previously written data if system crashes
From: Christoph Hellwig
Date: Wed Feb 25 2026 - 09:26:59 EST
On Tue, Feb 24, 2026 at 02:23:39PM -0800, Darrick J. Wong wrote:
> He did, way at the beginning: open a file, write 5000 bytes, close it,
> open again with O_SYNC, write 300 bytes, close it, force-reboot, and
> watch the file come back up with only 4096 bytes written.
Oh, I misunderstood the load and thought it would write the 300 bytes
after the previous 5000 bytes. If it overwrites the result is totally
expected.