Commit Graph

22 Commits

Author SHA1 Message Date
manu 440aad5bad Remove a warning that happens when the filesystem cleanly exits. Just
display a message when running in debug mode.
2014-08-16 16:32:04 +00:00
manu 075ba0e590 - Fix same vnodes associated with multiple cookies
The scheme used to retreive known nodes on lookup was flawed, as it only
used parent and name. This produced a different cookie for the same file
if it was renamed, when looking up ../ or when dealing with multiple files
associated with the same name through link(2).

We therefore abandon the use of node name and introduce hashed lists of
inodes. This causes a huge rewrite of reclaim code, which do not attempt
to keep parents allocated until all their children are reclaimed

- Fix race conditions in reclaim
There are a few situations where we issue multiple FUSE operations for
a PUFFS operation. On reclaim, we therefore have to wait for all FUSE
operation to complete, not just the current exchanges. We do this by
introducing node reference count with node_ref() and node_rele().

- Detect data loss caused by FAF
VOP_PUTPAGES causes FAF writes where the kernel does not check the
operation result. At least issue a warning on error.

- Enjoy FAF shortcut on setattr
No need to wait for the result if the kernel does not want it. There is
however an exception for setattr that touch the size, we need to wait
for completion because we have other operations queued for after the
resize.

- Fix fchmod() on write-open file
fchmod() on a node open with write privilege will send setattr with both mode and size set. This confuses some FUSE filesystem. Therefore we send two FUSE operations, one for mode, and one for size.

- Remove node TTL handling for netbsd-5 for simplicity sake. The code
still builds on netbsd-5 but does not have the node TTL feature anymore.
It works fine with kernel support on netbsd-6.
2012-07-21 05:49:42 +00:00
joerg 520acca96b Mark perfused_panic as dead. Canonical form of infinite loops is
for (;;). Remove completely redundant NOTREACHED markers.
2012-02-04 18:36:30 +00:00
manu 9724ab82d4 Make sure perfused exit when the filesystem crashed, so that unmount
is done. Failure to do so caused deadlocks, with operation that
held a lock on the root vnode and got stuck in perfused forever.

Approved by releng.
2012-02-03 15:54:15 +00:00
christos 109f5fba24 - remove dup included files
- use intptr_t instead of long where appropriate
- use perfused_ instead of perfuse_ for our own functions.
- more static
Fixes namespace collision of perfuse_mount with this and libperfuse.
2012-01-30 22:49:03 +00:00
manu ff9e6ef6d0 Fix the confusion between nodeid and inode numbers 2011-10-30 05:17:41 +00:00
joerg 9b838647dd Fast backward code to 1989 and use ANSI C consistently. Use __dead. 2011-08-30 20:17:00 +00:00
manu f8584de4e3 Fix warning 2011-08-09 07:00:13 +00:00
manu fb0fa57f18 Fix creds passed to FUSE when requests are done on behalf of the kernel.
We previously sent uid/gid set to -1, we now set it to 0.
2011-08-02 14:53:38 +00:00
manu 26381d518d Use SOCK_SEQPACKET in perfuse if available. This fix file operations hangs
where the FUSE filesyste replied to an operation and got an ENOBUFS it did
not handle.

We now are also able to cleanly unmount
2011-05-30 14:50:08 +00:00
manu 73963ae9de Enable the build of perfused and libperfuse 2011-05-09 08:51:08 +00:00
manu dfdc5ae18f Display actual error from FUSE on failures 2011-05-06 13:45:35 +00:00
manu 33c1bbe9da - fix warnings
- try to handle ENOBUFS in a nicer way
- use errx() for usage message, not err(), as we do not waht strerror(errno)
2011-04-25 04:30:59 +00:00
manu f4f951a0c1 Remove code supporting SOCK_STREAM, as SOCK_DGRAM works fine 2010-10-11 05:37:58 +00:00
manu 160a586559 Interm hack raising buffers for /dev/fuse socket used in the filesystem.
This works around read(2) system callsfailing with ENOBUFS.

This is a hack bedause there is no way to know that 4 * FUSE_BUFSIZE
will be enough to hold queued FUSE frames. It seems good enough at
mine.
2010-10-11 01:12:25 +00:00
manu 7ba588b3fb - Add debug santity checks
- Do not request peer creds anymore once we have them.
2010-09-20 06:45:38 +00:00
manu e9a8a6acc0 - Use SOCK_DGRAM instead of SOCK_STREAM, as the filesystem seems to
assume datagram semantics: when using SOCK_STREAM, if perfused sends
frames faster than the filesystem consumes them, it will grab multiple
frames at once and discard anything beyond the first one. For now the
code can work both with SOCK_DGRAM and SOCK_STREAM, but SOCK_STREAM
support will probably have to be removed for the sake of readability.

- Remeber to sync parent directories when moving a node

- In debug output, display the requeue type (readdir, write, etc...)
2010-09-15 01:51:43 +00:00
manu 1e672db8d2 - Do not checkfor peer credentials when perfused is autostarted and
therefore runs with filesystem privileges

- shut up warnings and debug messages when perfused is autostarted

- make perfused patch modifiable with CFLAGS for easier pkgsrc integration

- Fix build warnings
2010-09-07 02:11:04 +00:00
manu 5536686b23 More LP64 fixes 2010-09-06 01:40:24 +00:00
manu ef7e1877ae Build fixes for LP64 2010-09-01 14:57:24 +00:00
manu 1326029781 - if perfused is not already started (cannot connect to /dev/fuse),
FUSE filesystems will attempt to start it on their own, and will
communicate using a socketpair

- do not advertise NULL file handle as being valid when sending themback to the FUSE filesystem.

- unmount if we cannot talk to the FUSE process anymore

- set calling process gid properly

- debug message cleanup
2010-08-27 09:58:17 +00:00
manu a18d4c5a69 perfused(8) creates a /dev/fuse socket and performs PUFFS to FUSE relaying.
This is still a work in progress.
2010-08-25 07:18:01 +00:00