summaryrefslogtreecommitdiff
path: root/sys/miscfs/fuse
AgeCommit message (Collapse)Author
2018-05-16libfuse should not maintain state for FBT_READDIR. If a directory ishelg
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@
2018-05-15Use memset(3) instead of bzero(3) for consistency and as per POSIXhelg
recommendation.
2018-05-02Remove proc from the parameters of vn_lock(). The parameter isVisa Hankala
unnecessary because curproc always does the locking. OK mpi@
2018-04-28Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is alwaysVisa Hankala
curproc that does the locking or unlocking, so the proc parameter is pointless and can be dropped. OK mpi@, deraadt@
2018-04-27Move FREF() inside fd_getfile().Martin Pieuchot
ok visa@
2018-03-28Use RWL_IS_VNODE with locks that are acquired through VOP_LOCK(),Visa Hankala
to appease WITNESS. ext2fs and ffs already use the flag. The same locking pattern appears with other file systems too, so this patch addresses the remaining cases. OK mpi@
2018-02-10Syncronize filesystems to disk when suspending. Each mountpoint's vnodesTheo de Raadt
are pushed to disk. Dangling vnodes (unlinked files still in use) and vnodes undergoing change by long-running syscalls are identified -- and such filesystems are marked dirty on-disk while we are suspended (in case power is lost, a fsck will be required). Filesystems without dangling or busy vnodes are marked clean, resulting in faster boots following "battery died" circumstances. Tested by numerous developers, thanks for the feedback.
2018-01-22Use the proper address space when using a kernel that supportshelg
Supervisor Mode Access Prevention (SMAP) compiled with FUSE_DEBUG. While here, add some sanity check to the debug function fuse_dump_buff. Thanks to Thomas Jeunet. OK mpi@, helg@
2018-01-04Do a FREF/FRELE dance after calling fd_getfile().Martin Pieuchot
This should be enought to prevent `fp' to disapear while sleeping in malloc(9). ok helg@
2017-12-11In uvm Chuck decided backing store would not be allocated proactivelyTheo de Raadt
for blocks re-fetchable from the filesystem. However at reboot time, filesystems are unmounted, and since processes lack backing store they are killed. Since the scheduler is still running, in some cases init is killed... which drops us to ddb [noted by bluhm]. Solution is to convert filesystems to read-only [proposed by kettenis]. The tale follows: sys_reboot() should pass proc * to MD boot() to vfs_shutdown() which completes current IO with vfs_busy VB_WRITE|VB_WAIT, then calls VFS_MOUNT() with MNT_UPDATE | MNT_RDONLY, soon teaching us that *fs_mount() calls a copyin() late... so store the sizes in vfsconflist[] and move the copyin() to sys_mount()... and notice nfs_mount copyin() is size-variant, so kill legacy struct nfs_args3. Next we learn ffs_mount()'s MNT_UPDATE code is sharp and rusty especially wrt softdep, so fix some bugs adn add ~MNT_SOFTDEP to the downgrade. Some vnodes need a little more help, so tie them to &dead_vnops. ffs_mount calling DIOCCACHESYNC is causing a bit of grief still but this issue is seperate and will be dealt with in time. couple hundred reboots by bluhm and myself, advice from guenther and others at the hut
2017-11-30vn_open(9) does not pass the open(2) flags to VOP_CREATE(9) so we can'thelg
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@
2017-11-27Change fusefs_link to return EPERM if the source file is a directory.helg
Now aligns with link(2) man page and ffs regress tests. ok phessler@, jca@
2017-11-27Check access before creating a file or directory.helg
input and ok mpi@
2017-11-27When renaming a file, unlock the target vnode if the target file exists.helg
ok mpi@
2017-11-17Fixes the following bugs when getcwd(3) is used on a fuse file systemhelg
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@
2017-08-10Avoid possible NULL pointer dereference on fuseioctl()Ricardo Mestre
Found by Coverity Scan (CID 1453387) OK mpi@
2017-04-20Tweak lock inits to make the system runnable with witness(4)Visa Hankala
on amd64 and i386.
2017-01-10Remove the unused olddp parameter from function dounmount().Alexander Bluhm
OK mpi@ millert@
2016-09-07Fix fuse node lookups. Currently fusefs nodes in the kernel remember theMartin Natano
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
2016-08-30Use struct stat for storing attributes in fusebufs, because using structMartin Natano
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
2016-08-21There are three callers of update_vattr(). Two of them don't use theMartin Natano
updated struct vattr afterwards, so the call can be removed. Remove both calls and the function itself, inlining the last remaining call. ok millert
2016-08-16There is no sense in doing caching in fusefs. In case of a non-localMartin Natano
filesystem the tree can change behind our back, resulting in stale cache entries. "The only winning move is not to play." ok tedu beck mpi
2016-08-15Neuter fuse_vptofh() and fuse_fhtovp(). I implemented those functionsMartin Natano
under the assumption, that fuse_vget() has reasonable semantics, while this is not the case. fusefs_vget() only functions correctly, if the file in questions has recently been accessed and is still in the vnode cache of the userspace daemon associated with the mount point. As a matter of fact the fuse api doesn't feature a reasonable way to map inode numbers to a handle at all (see struct fuse_operations). ok guenther
2016-08-13Kill FUSE_ROOT_ID and use FUSE_ROOTINO instead. Also, remove one (ino_t)Martin Natano
cast from FUSE_ROOTINO, as it is already included in the #define. ok kettenis
2016-08-12Dedup vnode type information. Fuse stores the vnode type in two places:Martin Natano
vtype in struct fusefs_node and v_type in struct vnode. Given the fact, that fusefs_node structs are never allocated without an associated vnode and those two fields are always in sync, one of those locations is superfluous. While there remove the unused nlookup field. ok mpi
2016-06-19Remove the lockmgr() API. It is only used by filesystems, where it is aMartin Natano
trivial change to use rrw locks instead. All it needs is LK_* defines for the RW_* flags. tested by naddy and sthen on package building infrastructure input and ok jmc mpi tedu
2016-05-26The doforce variable isn't modified anywhere. Also, the only filesystemMartin Natano
left using it is fuse. It has been removed from all other filesystems. ok millert deraadt
2016-04-26Populate all necessary statfs members in .vfs_statfs. cd9660, udf,Martin Natano
msdosfs and nfsv2 don't set f_namemax. ntfs and ext2fs don't set f_namemeax and f_favail. fusefs doesn't set f_mntfromspec, f_favail and f_iosize. Also, make all filesystems use copy_statfs_info(), so that all statfs information is filled in correctly for the (sb != &mp->mnt-stat) case. ok stefan
2016-03-27When pulling and unmounting an umass USB stick, the file systemAlexander Bluhm
could end up in an inconsistent state. The fstype dependent mp->mnt_data was NULL, but the general mp was still listed as a valid mount point. Next access to the file system would crash with a NULL pointer dereference. If closing the device fails, the mount point must go away anyway. There is nothing we can do about it. Remove the workaround for the EIO error in the general unmount code, but do not generate any error in the file system specific unmount functions. OK natano@ beck@
2016-03-19Remove the unused flags argument from VOP_UNLOCK().natano
torture tested on amd64, i386 and macppc ok beck mpi stefan "the change looks right" deraadt
2016-03-17Set mnt_data to NULL after freeing the file system specific mount point.Alexander Bluhm
OK krw@ natano@ as part of a larger diff
2016-02-25Replace a usage of ROOTINO ((ufsino_t)2 with FUSE_ROOTINO ((ino_t)1).natano
The FUSE_ROOTINO define is used everywhere else in fuse, so the mismatch caused a file handle for the filesystem root to be falsely rejected with ESTALE. ok stefan@
2016-02-25fuse doesn't support NFS; prevent a uvm fault caused by claiming otherwisenatano
ok stefan@
2016-01-22Straightforward uiomovei -> uiomove conversion. All size arguments forStefan Kempf
uiomove had unsigned types already. Diff from Martin Natano.
2015-09-23remove lockmgr_printinfo stubs. from Martin NatanoTed Unangst
2015-09-02fairly easy size for free()Theo de Raadt
2015-07-19basic fh functions. better than panicing!Ted Unangst
from Martin Natano
2015-04-17Tweaks utimensat/futimens handling to always update ctime, even when bothPhilip Guenther
atime and mtime are UTIME_OMIT (at least for ufs, tmpfs, and ext2fs), and to correctly handle a timestamp of -1. ok millert@
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2015-02-19set the eofflag in readdir like we're supposed to.Ted Unangst
from Martin Natano
2015-02-10Convert uiomovei() with a constant size argument to uiomove().Miod Vallat
2015-02-10Switch uiomovei(..., sizeof whatever, ...) to uiomove().Miod Vallat
2015-02-10First step towards making uiomove() take a size_t size argument:Miod Vallat
- rename uiomove() to uiomovei() and update all its users. - introduce uiomove(), which is similar to uiomovei() but with a size_t. - rewrite uiomovei() as an uiomove() wrapper. ok kettenis@
2014-12-23knfTed Unangst
2014-12-23convert from nointr to waitokTed Unangst
2014-12-16primary change: move uvm_vnode out of vnode, keeping only a pointer.Ted Unangst
objective: vnode.h doesn't include uvm_extern.h anymore. followup changes: include uvm_extern.h or lock.h where necessary. ok and help from deraadt
2014-12-03use arc4random_buf() instead of (r << 32) | r; discussed with matthewTheo de Raadt
2014-11-18move arc4random prototype to systm.h. more appropriate for most codeTed Unangst
to include that than rdnvar.h. ok deraadt dlg
2014-10-03EOPNOTSUPP for quotactl. from Martin NatanoTed Unangst
2014-09-14remove uneeded proc.h includesJonathan Gray
ok mpi@ kspillner@