History log of /openbsd-current/lib/libfuse/fuse_ops.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.35 16-Jul-2018 helg

Implement FBT_FSYNC, which is called on fsync(2) and fdatasync(2).
Currently ignores the a_waitfor argument and always invokes the file
system's fsync implementation synchronously.

ok mpi@


# 1.34 08-Jun-2018 helg

Minor cleanup in ifuse_ops_setattr.

ok mpi@


# 1.33 22-May-2018 helg

Implement support for libfuse use_ino option. This returns the file
system's ino for VOP_GETATTR(9) and VOP_READDIR(9) rather than the
internally generated fuse ino.

ok mpi@


# 1.32 21-May-2018 helg

Reformat debug output to one line per opcode to make it easier to
interpret.

ok mpi@


# 1.31 20-May-2018 helg

Implement FBT_FLUSH. This is sent whenever a file descriptor is closed with
VOP_CLOSE(9). The associated FUSE file handle is however not closed at this
time and is instead closed on VOP_RELEASE(9) because that's the only time
it's guaranteed to be no longer used. Directory handles are now only closed
on VOP_RELEASE(9) for the same reason.

ok mpi@


# 1.30 16-May-2018 helg

libfuse should not maintain state for FBT_READDIR. If a directory is
opened multiple times (either from the same process or different
processes) then FUSE will not reliably return the directory entries to
both file descriptors.

ok mpi@


# 1.29 15-May-2018 helg

Use memset(3) instead of bzero(3) for consistency and as per POSIX
recommendation.


Revision tags: OPENBSD_6_3_BASE
# 1.28 30-Nov-2017 helg

vn_open(9) does not pass the open(2) flags to VOP_CREATE(9) so we can't
support FBT_CREATE. Fall back to FBT_MKNOD + FBT_OPEN so that a valid
sequence of FUSE messages is sent to the file system when creating files.

input from mpi@, otto@


# 1.27 17-Nov-2017 helg

Fixes the following bugs when getcwd(3) is used on a fuse file system

Endless loop if directory nested more than one level from root of file system
Current directory not found if the parent directory contains more children than
will fit in the buffer passed to VOP_READDIR(9)
Open and close directory in fusefs_readdir if dir is not already open.
Now behaves as if readdir_ino option was passed to fuse so that directories in
path have a valid ino.

ok mpi@


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.26 07-Sep-2016 natano

Fix fuse node lookups. Currently fusefs nodes in the kernel remember the
parent inode number for ".." lookups. This only works until the kernel
starts to reuse vnodes and the parent's vnode is reclaimed and the ino
to path mapping is removed from the userland process by libfuse. Fix
this by using reference counting in libfuse, so that parent mapping are
retained as long as a child uses them. Also, don't free the root node.

This commit resolves following issue:

$ doas fuse-zip ~/Downloads/foo.zip /mnt
$ ls /mnt
openbsd-www
$ grep -IR foo /usr/src > /dev/null # force vfs to reclaim vnodes
$ ls /mnt
ls: /mnt: No such file or directory
$

ok tedu


# 1.25 30-Aug-2016 natano

Use struct stat for storing attributes in fusebufs, because using struct
vattr in userspace is suboptimal as some related helpers are not
available, e.g. VATTR_NULL() and IFTOVT(). The conversion is now done in
the kernel where it belongs. As a side effect the <sys/vnode.h> include
can be removed from libfuse.

tweaks and ok guenther


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.24 05-Feb-2014 syl

check return values in libfuse.

inputs from stsp@.
ok stsp@.


# 1.23 29-Jan-2014 syl

Add fuse support for IO_APPEND.

ok beck@


# 1.22 23-Jan-2014 syl

Fix .readdir() code following what is done in .getdir().

Issue reported by Helg Bredow and Derrik Pates, thanks !
ok pelikan@


# 1.21 20-Jan-2014 syl

hook mknod() if create() implementation is not present.

from Derrik Pates (daemon AT now DOT ai), thanks!
ok guenther@


# 1.20 16-Jan-2014 syl

Add support for mknod in fuse.

OK tedu@
"it looks good to me" from guenther@


# 1.19 02-Jan-2014 syl

Call fuse callbacks on FBT_INIT and FBT_DESTROY.

Issue reported by Helg Bredow, thanks!

With inputs from tedu@
ok tedu@


# 1.18 20-Dec-2013 syl

Add support for truncate in fuse.

Input from millert@.

Ok millert@, tedu@.


# 1.17 09-Dec-2013 beck

Fix issues with dirent returning junk due to removal of bzero in version 1.14.
Ensure d_name string is nul terminated and the correct length in d_namlen.
noticed by pelikan@
ok syl@ guenther@


# 1.16 03-Dec-2013 syl

Does not append a NUL character to buf in readlink(2).
Add some check for malloc(3) return values.

From Derrik Pates (daemon AT now DOT ai), thanks.
OK millert@


# 1.15 03-Dec-2013 syl

Add support for FBT_RECLAIM that allow us to free the representation
of vnode in userspace.

"I think it's right" from tedu@.


# 1.14 21-Nov-2013 syl

Fix a big memory leak in libfuse.

Spotted by sthen@
With some input from stsp@ and tested by mpk@ and sthen@
ok sthen@, stsp@


# 1.13 08-Oct-2013 guenther

1) our dirent entries are now 8 byte aligned.
2) d_type isn't the file's st_mode, but rather a type that can be derived
from the file's mode.
3) the readdir callback should be setting d_off. Assume for now that
fuse-based filesystems can operate with length based offsets
4) if the file type is unknown, use DT_UNKNOWN explictly instead
of assuming that's equal to zero

ok syl@


# 1.12 07-Oct-2013 syl

Fix some different signedness error. this commit make clang happier.

Thanks to Pedro Martelletto.


# 1.11 07-Oct-2013 syl

Remove an unused variable and a useless bzero


# 1.10 07-Oct-2013 syl

Refactor fb_len and fb_err handling in libfuse.


# 1.9 07-Oct-2013 syl

Remove useless debug code from libfuse


# 1.8 07-Oct-2013 syl

Adapt libfuse to FUSE kernel changes


# 1.7 10-Aug-2013 syl

Remove some useless DPRINTF.


# 1.6 08-Aug-2013 guenther

Prep for big ino_t: cast to unsigned long long and format with %ll or %q

httpd correction and ok kettenis@


Revision tags: OPENBSD_5_4_BASE
# 1.5 14-Jun-2013 syl

hard code default values in the struct stat returned by getattr.
Some poor fuse client does not set all the struct stat fields...

OK pirofti@ and beck@


# 1.4 05-Jun-2013 tedu

rename should be working now, from Sylvestre Gallon


# 1.3 04-Jun-2013 tedu

fix readdir, from sylvestre


# 1.2 03-Jun-2013 tedu

rcsids


# 1.1 03-Jun-2013 tedu

add userland fuse library. ok beck deraadt
from Sylvestre Gallon ccna.syl gmail.com


# 1.34 08-Jun-2018 helg

Minor cleanup in ifuse_ops_setattr.

ok mpi@


# 1.33 22-May-2018 helg

Implement support for libfuse use_ino option. This returns the file
system's ino for VOP_GETATTR(9) and VOP_READDIR(9) rather than the
internally generated fuse ino.

ok mpi@


# 1.32 21-May-2018 helg

Reformat debug output to one line per opcode to make it easier to
interpret.

ok mpi@


# 1.31 20-May-2018 helg

Implement FBT_FLUSH. This is sent whenever a file descriptor is closed with
VOP_CLOSE(9). The associated FUSE file handle is however not closed at this
time and is instead closed on VOP_RELEASE(9) because that's the only time
it's guaranteed to be no longer used. Directory handles are now only closed
on VOP_RELEASE(9) for the same reason.

ok mpi@


# 1.30 16-May-2018 helg

libfuse should not maintain state for FBT_READDIR. If a directory is
opened multiple times (either from the same process or different
processes) then FUSE will not reliably return the directory entries to
both file descriptors.

ok mpi@


# 1.29 15-May-2018 helg

Use memset(3) instead of bzero(3) for consistency and as per POSIX
recommendation.


Revision tags: OPENBSD_6_3_BASE
# 1.28 30-Nov-2017 helg

vn_open(9) does not pass the open(2) flags to VOP_CREATE(9) so we can't
support FBT_CREATE. Fall back to FBT_MKNOD + FBT_OPEN so that a valid
sequence of FUSE messages is sent to the file system when creating files.

input from mpi@, otto@


# 1.27 17-Nov-2017 helg

Fixes the following bugs when getcwd(3) is used on a fuse file system

Endless loop if directory nested more than one level from root of file system
Current directory not found if the parent directory contains more children than
will fit in the buffer passed to VOP_READDIR(9)
Open and close directory in fusefs_readdir if dir is not already open.
Now behaves as if readdir_ino option was passed to fuse so that directories in
path have a valid ino.

ok mpi@


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.26 07-Sep-2016 natano

Fix fuse node lookups. Currently fusefs nodes in the kernel remember the
parent inode number for ".." lookups. This only works until the kernel
starts to reuse vnodes and the parent's vnode is reclaimed and the ino
to path mapping is removed from the userland process by libfuse. Fix
this by using reference counting in libfuse, so that parent mapping are
retained as long as a child uses them. Also, don't free the root node.

This commit resolves following issue:

$ doas fuse-zip ~/Downloads/foo.zip /mnt
$ ls /mnt
openbsd-www
$ grep -IR foo /usr/src > /dev/null # force vfs to reclaim vnodes
$ ls /mnt
ls: /mnt: No such file or directory
$

ok tedu


# 1.25 30-Aug-2016 natano

Use struct stat for storing attributes in fusebufs, because using struct
vattr in userspace is suboptimal as some related helpers are not
available, e.g. VATTR_NULL() and IFTOVT(). The conversion is now done in
the kernel where it belongs. As a side effect the <sys/vnode.h> include
can be removed from libfuse.

tweaks and ok guenther


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.24 05-Feb-2014 syl

check return values in libfuse.

inputs from stsp@.
ok stsp@.


# 1.23 29-Jan-2014 syl

Add fuse support for IO_APPEND.

ok beck@


# 1.22 23-Jan-2014 syl

Fix .readdir() code following what is done in .getdir().

Issue reported by Helg Bredow and Derrik Pates, thanks !
ok pelikan@


# 1.21 20-Jan-2014 syl

hook mknod() if create() implementation is not present.

from Derrik Pates (daemon AT now DOT ai), thanks!
ok guenther@


# 1.20 16-Jan-2014 syl

Add support for mknod in fuse.

OK tedu@
"it looks good to me" from guenther@


# 1.19 02-Jan-2014 syl

Call fuse callbacks on FBT_INIT and FBT_DESTROY.

Issue reported by Helg Bredow, thanks!

With inputs from tedu@
ok tedu@


# 1.18 20-Dec-2013 syl

Add support for truncate in fuse.

Input from millert@.

Ok millert@, tedu@.


# 1.17 09-Dec-2013 beck

Fix issues with dirent returning junk due to removal of bzero in version 1.14.
Ensure d_name string is nul terminated and the correct length in d_namlen.
noticed by pelikan@
ok syl@ guenther@


# 1.16 03-Dec-2013 syl

Does not append a NUL character to buf in readlink(2).
Add some check for malloc(3) return values.

From Derrik Pates (daemon AT now DOT ai), thanks.
OK millert@


# 1.15 03-Dec-2013 syl

Add support for FBT_RECLAIM that allow us to free the representation
of vnode in userspace.

"I think it's right" from tedu@.


# 1.14 21-Nov-2013 syl

Fix a big memory leak in libfuse.

Spotted by sthen@
With some input from stsp@ and tested by mpk@ and sthen@
ok sthen@, stsp@


# 1.13 08-Oct-2013 guenther

1) our dirent entries are now 8 byte aligned.
2) d_type isn't the file's st_mode, but rather a type that can be derived
from the file's mode.
3) the readdir callback should be setting d_off. Assume for now that
fuse-based filesystems can operate with length based offsets
4) if the file type is unknown, use DT_UNKNOWN explictly instead
of assuming that's equal to zero

ok syl@


# 1.12 07-Oct-2013 syl

Fix some different signedness error. this commit make clang happier.

Thanks to Pedro Martelletto.


# 1.11 07-Oct-2013 syl

Remove an unused variable and a useless bzero


# 1.10 07-Oct-2013 syl

Refactor fb_len and fb_err handling in libfuse.


# 1.9 07-Oct-2013 syl

Remove useless debug code from libfuse


# 1.8 07-Oct-2013 syl

Adapt libfuse to FUSE kernel changes


# 1.7 10-Aug-2013 syl

Remove some useless DPRINTF.


# 1.6 08-Aug-2013 guenther

Prep for big ino_t: cast to unsigned long long and format with %ll or %q

httpd correction and ok kettenis@


Revision tags: OPENBSD_5_4_BASE
# 1.5 14-Jun-2013 syl

hard code default values in the struct stat returned by getattr.
Some poor fuse client does not set all the struct stat fields...

OK pirofti@ and beck@


# 1.4 05-Jun-2013 tedu

rename should be working now, from Sylvestre Gallon


# 1.3 04-Jun-2013 tedu

fix readdir, from sylvestre


# 1.2 03-Jun-2013 tedu

rcsids


# 1.1 03-Jun-2013 tedu

add userland fuse library. ok beck deraadt
from Sylvestre Gallon ccna.syl gmail.com


# 1.28 30-Nov-2017 helg

vn_open(9) does not pass the open(2) flags to VOP_CREATE(9) so we can't
support FBT_CREATE. Fall back to FBT_MKNOD + FBT_OPEN so that a valid
sequence of FUSE messages is sent to the file system when creating files.

input from mpi@, otto@


# 1.27 17-Nov-2017 helg

Fixes the following bugs when getcwd(3) is used on a fuse file system

Endless loop if directory nested more than one level from root of file system
Current directory not found if the parent directory contains more children than
will fit in the buffer passed to VOP_READDIR(9)
Open and close directory in fusefs_readdir if dir is not already open.
Now behaves as if readdir_ino option was passed to fuse so that directories in
path have a valid ino.

ok mpi@


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.26 07-Sep-2016 natano

Fix fuse node lookups. Currently fusefs nodes in the kernel remember the
parent inode number for ".." lookups. This only works until the kernel
starts to reuse vnodes and the parent's vnode is reclaimed and the ino
to path mapping is removed from the userland process by libfuse. Fix
this by using reference counting in libfuse, so that parent mapping are
retained as long as a child uses them. Also, don't free the root node.

This commit resolves following issue:

$ doas fuse-zip ~/Downloads/foo.zip /mnt
$ ls /mnt
openbsd-www
$ grep -IR foo /usr/src > /dev/null # force vfs to reclaim vnodes
$ ls /mnt
ls: /mnt: No such file or directory
$

ok tedu


# 1.25 30-Aug-2016 natano

Use struct stat for storing attributes in fusebufs, because using struct
vattr in userspace is suboptimal as some related helpers are not
available, e.g. VATTR_NULL() and IFTOVT(). The conversion is now done in
the kernel where it belongs. As a side effect the <sys/vnode.h> include
can be removed from libfuse.

tweaks and ok guenther


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.24 05-Feb-2014 syl

check return values in libfuse.

inputs from stsp@.
ok stsp@.


# 1.23 29-Jan-2014 syl

Add fuse support for IO_APPEND.

ok beck@


# 1.22 23-Jan-2014 syl

Fix .readdir() code following what is done in .getdir().

Issue reported by Helg Bredow and Derrik Pates, thanks !
ok pelikan@


# 1.21 20-Jan-2014 syl

hook mknod() if create() implementation is not present.

from Derrik Pates (daemon AT now DOT ai), thanks!
ok guenther@


# 1.20 16-Jan-2014 syl

Add support for mknod in fuse.

OK tedu@
"it looks good to me" from guenther@


# 1.19 02-Jan-2014 syl

Call fuse callbacks on FBT_INIT and FBT_DESTROY.

Issue reported by Helg Bredow, thanks!

With inputs from tedu@
ok tedu@


# 1.18 20-Dec-2013 syl

Add support for truncate in fuse.

Input from millert@.

Ok millert@, tedu@.


# 1.17 09-Dec-2013 beck

Fix issues with dirent returning junk due to removal of bzero in version 1.14.
Ensure d_name string is nul terminated and the correct length in d_namlen.
noticed by pelikan@
ok syl@ guenther@


# 1.16 03-Dec-2013 syl

Does not append a NUL character to buf in readlink(2).
Add some check for malloc(3) return values.

From Derrik Pates (daemon AT now DOT ai), thanks.
OK millert@


# 1.15 03-Dec-2013 syl

Add support for FBT_RECLAIM that allow us to free the representation
of vnode in userspace.

"I think it's right" from tedu@.


# 1.14 21-Nov-2013 syl

Fix a big memory leak in libfuse.

Spotted by sthen@
With some input from stsp@ and tested by mpk@ and sthen@
ok sthen@, stsp@


# 1.13 08-Oct-2013 guenther

1) our dirent entries are now 8 byte aligned.
2) d_type isn't the file's st_mode, but rather a type that can be derived
from the file's mode.
3) the readdir callback should be setting d_off. Assume for now that
fuse-based filesystems can operate with length based offsets
4) if the file type is unknown, use DT_UNKNOWN explictly instead
of assuming that's equal to zero

ok syl@


# 1.12 07-Oct-2013 syl

Fix some different signedness error. this commit make clang happier.

Thanks to Pedro Martelletto.


# 1.11 07-Oct-2013 syl

Remove an unused variable and a useless bzero


# 1.10 07-Oct-2013 syl

Refactor fb_len and fb_err handling in libfuse.


# 1.9 07-Oct-2013 syl

Remove useless debug code from libfuse


# 1.8 07-Oct-2013 syl

Adapt libfuse to FUSE kernel changes


# 1.7 10-Aug-2013 syl

Remove some useless DPRINTF.


# 1.6 08-Aug-2013 guenther

Prep for big ino_t: cast to unsigned long long and format with %ll or %q

httpd correction and ok kettenis@


Revision tags: OPENBSD_5_4_BASE
# 1.5 14-Jun-2013 syl

hard code default values in the struct stat returned by getattr.
Some poor fuse client does not set all the struct stat fields...

OK pirofti@ and beck@


# 1.4 05-Jun-2013 tedu

rename should be working now, from Sylvestre Gallon


# 1.3 04-Jun-2013 tedu

fix readdir, from sylvestre


# 1.2 03-Jun-2013 tedu

rcsids


# 1.1 03-Jun-2013 tedu

add userland fuse library. ok beck deraadt
from Sylvestre Gallon ccna.syl gmail.com