-
-
Notifications
You must be signed in to change notification settings - Fork 535
Closed
Description
What are the expections of osxfuse when the userspace daemon is sent a create request, but the file already exists? Should it return EEXIST, just open the file, or what?
Some notes on what I've determined experimentally:
- If I call open(2) with several workers in parallel using
O_CREAT, on Linux I only ever receive a singlecreaterequest, but with osxfuse I receive many. So I conclude that Linux is holding a lock around the "look up, find doesn't exist, send create request" process, but osxfuse isn't. - Of course this question still applies on Linux if a file may be created remotely, so that it springs into existence after the kernel does a lookup but before it calls create.
- Unless I've missed something, osxfuse doesn't seem to pass on the
O_EXCLflag to the userspace daemon, so the daemon probably can't be responsible for deciding whether it is safe to open the file if it already exists. - Returning
EEXISTappears to do the right thing whetherO_EXCLis set or not, but just opening fails to work right ifO_EXCLis set.