Re: File name is not persisted if opened with O_SYNC and O_TRUNC flags

From: Christoph Hellwig

Date: Fri Feb 13 2026 - 02:35:35 EST


On Thu, Feb 12, 2026 at 02:51:47PM +0300, Vyacheslav Kovalevsky wrote:
> Detailed description
> ====================
>
> Hello, there seems to be an issue with O_SYNC flag when used together with
> O_TRUNC on various file systems.
> Opening a file with O_SYNC (or using fsync(fd)) should persist directory
> entry.

No, it should not. I'm not sure who hallucinated, but O_SYNC has always
always applied to persistency semantics after writes and nothing else.