Comment 11 for bug 2041670

Revision history for this message
In , brauner (brauner-linux-kernel-bugs) wrote :

(In reply to Colin Ian King from comment #7)
> The file is created but the fd is -1. Surely the semantics of a O_CREAT
> failure are a file that's not created.

Not necessarily. You're requesting a file to be created and to be opened afterwards with O_DIRECT support and what we do in this case is fail the open even though the create was successful.

Stuff like that can also happen in other cases. In containers you can end up with scenarios where you fail to open a file you created - probably hard to create but possible. Other scenarios would be were your LSM allows you to create files but not to open them.