VFS/Posix question

Thomas Schoebel-Theuer (schoebel@informatik.uni-stuttgart.de)
13 Feb 1997 11:16:41 GMT


I'm just doing some patches in the kernel for enabling omirr-support.
omirr (online mirror) will support *symmetric* online mirroring of filesystems
once it is available.

I have found the following curiosity: if open() is called with flags
O_CREAT | O_EXCL , it returns an error if the "file" already exists.
However, what is really implemented is to check whether _some_ inode
with the given name already exists. If the name exists in the form of
a symlink pointing in turn to a non-existant name, it will be an error, too.
However, I would expect that the non-existing name should be created
instead (without returning an error), as is the case with leaving out the
O_EXCL bit.

I don't have access to the Posix standards. Could anyone clarify what
should be the correct behaviour?

-- Thomas