fluiday / macfuse

Automatically exported from code.google.com/p/macfuse
Other
0 stars 0 forks source link

O_APPEND in io_direct mode isn't handled #233

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When running the fuse server using direct io mode (on open), if the app
calls open with O_APPEND, and then calls write, the write has always offset
0.  and, the O_APPEND flags isn't passed to open either, so the fuse_server
cannot correct for this.

looking at the code in ./core/10.5/fusefs/fuse_vnops.c, in the case of not
direct io, the offset is correctly set to the file length when a file is
opened with O_APPEND.  in the direct io case, it isn't.  

is this bug?

Frans Kaashoek (kaashoek@mit.edu)

Original issue reported on code.google.com by fkaash...@gmail.com on 5 Jul 2007 at 3:46

GoogleCodeExporter commented 9 years ago
1. You really shouldn't be using direct_io as far as possible because it's sort 
of an abomination.

2. direct_io means that you are implicitly agreeing to have the kernel not care 
about the file size (no buffer cache 
either)--it's mainly for synthetic file systems like /proc.

3. You also lose mmap() if you use direct_io. Therefore, you can't execute 
programs off a file system that's 
mounted with direct_io.

Original comment by si...@gmail.com on 5 Jul 2007 at 5:42

GoogleCodeExporter commented 9 years ago
Not a bug: if file size matters, do not use direct_io.

Original comment by si...@gmail.com on 5 Jul 2007 at 6:22