summaryrefslogtreecommitdiff
path: root/sys/miscfs
AgeCommit message (Collapse)Author
2020-05-13Use seltrue_kqfilter() instead of hand-rolling it in multiple drivers.Martin Pieuchot
ok visa@
2020-04-08Make fifo_kqfilter() honor FREAD|FWRITE just like fifo_poll() does.Martin Pieuchot
Prevent generating events that do not correspond to how the fifo has been opened. ok visa@, millert@
2020-04-08Pass correct socket to the write kqueue filter.Martin Pieuchot
Make EVFILT_WRITE notifications on fifo work. ok visa@, millert@
2020-04-07Abstract the head of knote lists. This allows extending the lists,Visa Hankala
for example, with locking assertions. OK mpi@, anton@
2020-04-03Return POLLERR instead of EINVAL in fusepoll().Martin Pieuchot
ok kettenis@
2020-02-20Replace field f_isfd with field f_flags in struct filterops to allowVisa Hankala
adding more filter properties without cluttering the struct. OK mpi@, anton@
2020-01-20struct vops is not modified during runtime so use const which moves eachClaudio Jeker
into read-only data segment. OK deraadt@ tedu@
2020-01-08Convert infinite sleeps to tsleep_nsec(9).Martin Pieuchot
ok bluhm@
2019-12-31Use C99 designated initializers with struct filterops. In addition,Visa Hankala
make the structs const so that the data are put in .rodata. OK mpi@, deraadt@, anton@, bluhm@
2019-12-26Convert struct vfsops initializer to C99 style.Alexander Bluhm
OK visa@
2019-12-12Reintroduce socket locking inside socket event filters.Visa Hankala
Tested by anton@, sashan@ OK mpi@, anton@, sashan@
2019-12-05Convert infinite sleeps to tsleep_nsec(9).Martin Pieuchot
ok jca@
2019-10-19Unlock the vnode in vop_inactive of deadfs. The unlock operation isVisa Hankala
a no-op at the moment, but future work will introduce an actual lock that has to be released. OK mpi@ anton@
2019-08-05Allow concurrent reads of the f_offset field of struct file byanton
serializing both read/write operations using the existing file mutex. The vnode lock still grants exclusive write access to the offset; the mutex is only used to make the actual write atomic and prevent any concurrent reader from observing intermediate values. ok mpi@ visa@
2019-07-12Revert anton@ changes about read/write unlockingsolene
https://marc.info/?l=openbsd-cvs&m=156277704122293&w=2 ok anton@
2019-07-10Make read/write of the f_offset field belonging to struct file MP-safe;anton
as part of the effort to unlock the kernel. Instead of relying on the vnode lock, introduce a dedicated lock per file. Exclusive write access is granted using the new foffset_enter and foffset_leave API. A convenience function foffset_get is also available for threads that only need to read the current offset. The lock acquisition order in vn_write has been changed to match the one in vn_read in order to avoid a potential deadlock. This change also gets rid of a documented race in vn_read(). Inspired by the FreeBSD implementation. With help and ok mpi@ visa@
2018-07-30Use FNONBLOCK instead of SS_NBIO to check/indicate that the I/O modeMartin Pieuchot
for sockets is non-blocking. This allows us to G/C SS_NBIO. Having to keep the two flags in sync in a mp-safe way is complicated. This change introduce a behavior change in sosplice(), it can now always block. However this should not matter much due to the socket lock being taken beforhand. ok bluhm@, benno@, visa@
2018-07-18Replace VATTR_NULL() with memset(3) in fusefs_getattr(). VATTR_NULL()helg
sets all members of struct vattr to VNOVAL (-1) instead of 0, which is what is appropriate here. The VATTR_NULL() macro is intended for initialising struct vattr when setting attributes. ok mpi@
2018-07-17Don't send FBT_DESTROY if the FUSE connection is still PENDING. Alsohelg
don't attempt to determine the size of the root inode. This is because we don't need to know the size of directories and FBT_GETATTR will also cause a deadlock if fuse_unmount(3) is called before the file system has a chance to process fbufs. Add corresponding regression test. ok mpi@
2018-07-16Insert the appropriate uvm_vnp_uncache(9) and uvm_vnp_setsize(9)helg
kernel calls to ensure that the UVM cache for memory mapped files is up to date. ok mpi@
2018-07-16Implement FBT_FSYNC, which is called on fsync(2) and fdatasync(2).helg
Currently ignores the a_waitfor argument and always invokes the file system's fsync implementation synchronously. ok mpi@
2018-07-05Do not leak memory and a fp reference when !root passes `allow_other'.Martin Pieuchot
Fix CID 1470236. ok helg@
2018-06-27Refactor to simplify - no functional change.helg
ok mpi@
2018-06-25Remove unused fbuf parameter from fuse_device_cleanup().helg
ok mpi@
2018-06-21Don't timeout on fb_queue(9). The current process will blockhelg
indefinitely and cannot be interrupted or killed. This is consistent with how VFS system calls should behave. If the file system becomes unresponsive then the only sane solution is for the user to kill the file system daemon. Implementing the equivalent of nfs -osoft or -ointr to either timeout or allow the blocking FUSE operation to be interrupted can be considered in a future patch. ok mpi@
2018-06-21Drop redundant "node == parent node" checks from VOP_RMDIR()Visa Hankala
implementations. Rely on the VFS layer to do the checking. OK mpi@, helg@
2018-06-20Fix formatting.helg
2018-06-19Changes the default mount behaviour so only the user that mounts thehelg
file system can access it unless the allow_other mount options is specified. The allow_other mount option makes the file system available to other users just like any other mounted file system. ok mpi@
2018-06-19Send the calling thread id, effective uid and gid, and umask to thehelg
FUSE file system. fuse_get_context(3) will now return the correct values. ok mpi@
2018-06-18Allow write for non-regular files when file system is mounted read-only.helg
Don't ask file system to check file access; always behave as if default_permissions option was specified. (this may change in a later commit) ok mpi@
2018-06-18chmod(2) should return EFTYPE if the effective user ID is not thehelg
super-user, the mode includes the sticky bit (S_ISVTX), and path does not refer to a directory. ok mpi@
2018-06-07Make callers of VOP_CREATE(9) and VOP_MKNOD(9) responsible forVisa Hankala
unlocking the directory vnode. OK mpi@, helg@
2018-06-06Pass the socket to sounlock(), this prepare the terrain for per-socketMartin Pieuchot
locking. ok visa@, bluhm@
2018-05-23Change wait text when waiting for FUSE file system daemon to respond.helg
ok mpi@
2018-05-22Implement support for libfuse use_ino option. This returns the filehelg
system's ino for VOP_GETATTR(9) and VOP_READDIR(9) rather than the internally generated fuse ino. ok mpi@
2018-05-21The flush operation is optional so don't return ENOSYS if the FUSE file systemhelg
doesn't implement it. ok mpi@
2018-05-20Prevent race condition if file system is accessed before it ishelg
initialised. Rather than failing, requests are now queued. ok mpi@
2018-05-20Implement FBT_FLUSH. This is sent whenever a file descriptor is closed withhelg
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@
2018-05-17Pass size argument to free(9).helg
ok mpi@
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-04-08AF_LOCAL was a failed attempt (by POSIX?) to seem less UNIX-specific, butPhilip Guenther
AF_UNIX is both the historical _and_ standard name, so prefer and recommend it in the headers, manpages, and kernel. ok miller@ deraadt@ schwarze@
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-19Grab solock() inside soconnect2() instead of asserting for it to be held.Martin Pieuchot
ok millert@
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@