Comments (4)
> I can understand that O_CREAT gets stripped
Although on second thought, why even strip O_CREAT? The Linux code doesn't,
and it
leads to stuff like:
#if (__FreeBSD__ >= 10)
fd = open(path, fi->flags | O_CREAT, mode);
#else
fd = open(path, fi->flags, mode);
#endif
as found in fusexmp_fh.c (and notably missing from fuse-python, which is what
led me
to this bug in the first place)
Or if the OS pre-strips O_CREAT, why not put it back, in the interest of
consistent
cross-platform fuse behaviour?
Original comment by [email protected]
on 27 Feb 2007 at 9:49
from macfuse.
O_CREAT doesn't need to be stripped. I just "forgot" to add it back after a
phase of experimentation when I
was coming up with the file descriptor management part of MacFUSE. It's ironic
that I even "fixed" it in
fusexmp instead of the kernel. I'll fix it better. If you are willing to
recompile the kernel extension from
source, change line 314 of fusefs/fuse_vnops.c to have "O_CREAT | O_RDWR"
instead of just "O_RDWR".
The O_RDWR is by design, on purpose. It's because of the way things work in Mac
OS X. When you call the
open() system call with O_CREAT, even though the call is atomic from the
caller's standpoint, I get two
discrete vnode operation calls: vnop_create and vnop_open. In Mac OS X, within
a loadable file system's vnode
operations, you don't have access to file descriptors. In particular, in the
create (which obviously occurs before
the open), I can't know how this file is going to be opened later. Now, POSIX
lets you do things like 'open
("foo", O_CREAT | O_WRONLY, 0000)' -- that is, using the descriptor, you can
write to the file, even though its
on-disk permissions are going to disallow writing for a subsequent open. If I
am to support such semantics, I
need to acquire through FUSE_CREATE a "maximally permissive" file descriptor
that will let me do reads/writes
-- as the need be -- as dictated by the subsequent open associated with the
create. There are many other
"interesting" details about this scheme that you can see by looking at the code.
Original comment by [email protected]
on 27 Feb 2007 at 10:18
from macfuse.
OK, that's quite a good answer. I didn't know the details of OS X vnode
semantics,
but it's makes sense.
I can survive with O_WRONLY being mapped to O_RDWR -- but the missing O_CREAT
was
causing real headaches.
Thanks for your prompt reply!
Original comment by [email protected]
on 27 Feb 2007 at 2:06
from macfuse.
O_CREAT stripping fixed in the next release.
Original comment by [email protected]
on 27 Feb 2007 at 7:43
- Changed state: Fixed
from macfuse.
Related Issues (20)
- sshfs asks for password twice, even when ssh agent is running HOT 1
- SSHFS: kernel panic with rename followed by write HOT 8
- Enter one-line summary HOT 1
- Save changes to Word document (Microsoft Office 2004) appears to break ssh connection HOT 30
- Finder locks up requiring hard reboot during use of sshfs HOT 13
- SSHFS - will not accept a password with a ' inside HOT 1
- SSHFS GUI doesn't allow for use of public keys HOT 1
- O_WRONLY mangled into O_RDWR during a CREATE opcode? HOT 2
- MacFuse breaks TextMates auto-file-reload doohickie HOT 9
- SSHFS GUI doesn't handle first time SSH connections well HOT 1
- SSHFS dies if remote machine doesn't have SFTP enabled HOT 1
- Enter one-line summary HOT 2
- Permission denied when file A replaces file B with mv command HOT 3
- Panic copying to ssh volume HOT 3
- sshfs.app won't use an ssh key to connect HOT 1
- SSHFS don't allow me copy big files HOT 3
- SSHFS cause system to freeze if network config changes HOT 8
- sshfs kernel panic after 10.4.9 update HOT 5
- SSHFS: Does not connect without username HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from macfuse.