summaryrefslogtreecommitdiff
path: root/sys/tmpfs
AgeCommit message (Collapse)Author
2019-01-21Introduce a dedicated entry point data structure for file locks. This new dataanton
structure allows for better tracking of pending lock operations which is essential in order to prevent a use-after-free once the underlying vnode is gone. Inspired by the lockf implementation in FreeBSD. ok visa@ Reported-by: syzbot+d5540a236382f50f1dac@syzkaller.appspotmail.com
2018-10-22More "explicitely" -> "explicitly" in various comments.Kenneth R Westerback
ok guenther@ tb@ deraadt@
2018-06-07Make callers of VOP_CREATE(9) and VOP_MKNOD(9) responsible forVisa Hankala
unlocking the directory vnode. OK mpi@, helg@
2018-05-28Call vput(dvp) in vnode operation functions instead of calling it inVisa Hankala
the file allocation routine. This allows stepwise changing of the vnode locking discipline. OK mpi@
2018-05-27Drop unnecessary `p' parameter from vget(9).Visa Hankala
OK mpi@
2018-05-23Fix build without DIAGNOSTIC, ok mikeb@Reyk Floeter
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-06Now that the args are passed in by the caller there is no need to callPatrick Wildt
copyin(9) ourselves anymore. Fixes tmpfs after recent changes. ok bluhm@ deraadt@ 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-03-07add "int stall" argument required by filesystem stall code; from Tomohiro KusumiTheo de Raadt
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-09-08If you use sys/param.h, you don't need sys/types.hTheo de Raadt
2017-04-20Tweak lock inits to make the system runnable with witness(4)Visa Hankala
on amd64 and i386.
2016-09-22Fix indentation. No binary change.Jonathan Gray
2016-09-15all pools have their ipl set via pool_setipl, so fold it into pool_init.David Gwynne
the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
2016-08-23pool_setipl for tmpfs.David Gwynne
2016-07-22Set the vfs_systcl member of the vsfops struct to eopnotsupp. While we checkMark Kettenis
for a null pointer now, all other filesystems fill in the complete table. ok deraadt@, tom@
2016-07-11don't allow mounting with noval owner. panics later.Ted Unangst
reported by Tim Newsham at NCC. ok millert natano
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-02Fix some issues wrt timestamp updating. The tmpfs_read() andMartin Natano
tmpfs_readlink() functions ignore the noatime mount option, tmpfs_read() should not update atime when zero bytes have been requested (as per posix) and tmpfs_write() should update mtime and ctime (as per posix). ok espie
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-02-06Convert to uiomove. From Martin Natano.Stefan Kempf
2016-01-13kill malloc(9) pointless check, malloc(9) call is using M_WAITOK flag and ↵Gleydson Soares
thus will sleep until get memory available so shouln't fail. OK deraadt@ mmcc@
2015-12-11fix nde structure initialization, noticed in netbsd pr 50381 by mmcc@Bob Beck
by ensuring the structure is zeroed when allocated from the pool ok mmcc@, stsp@
2015-12-08correct errant spacingTed Unangst
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-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@
2015-01-21remove #if 0 cdefs.h blocksTheo de Raadt
2014-12-23change pool allocator to null and pass waitok to indicate nointrTed Unangst
2014-12-17remove lock.h from uvm_extern.h. another holdover from the simpletonlockTed Unangst
era. fix uvm including c files to include lock.h or atomic.h as necessary. ok deraadt
2014-12-17Prefer MADV_* over POSIX_MADV_* in kernel for consistency: the latterPhilip Guenther
doesn't have all the values and therefore can't be used everywhere. ok deraadt@ kettenis@
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-15Use MAP_INHERIT_* for the 'inh' argument to the UMV_MAPFLAG() macro,Philip Guenther
eliminating the must-be-kept-in-sync UVM_INH_* macros ok deraadt@ tedu@
2014-12-04Disallow file allocations on directories that have been removedDavid Coppa
(tn_links == 0). Failure to enforce such a check can lead to the violation of the assumption that removed directories should not contain directory entries and thus trigger a kernel diagnostic assertion (panic). Fix provided by Pedro Martelletto, thanks! OK millert@
2014-11-18move arc4random prototype to systm.h. more appropriate for most codeTed Unangst
to include that than rdnvar.h. ok deraadt dlg
2014-11-16Replace a plethora of historical protection options with justTheo de Raadt
PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove UVM_ADV_* wrapper, using the standard names. ok doug guenther kettenis
2014-11-02tmpfs free sizesTed Unangst
2014-11-02unnecessary malloc.h includeTed Unangst
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-07-08decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hTheo de Raadt
don't need to be married. ok guenther miod beck jsing kettenis
2014-03-28Reduce uvm include madness. Use <uvm/uvm_extern.h> instead ofMartin Pieuchot
<uvm/uvm.h> if possible and remove double inclusions. ok beck@, mlarkin@, deraadt@
2014-02-28guenther's addition of filechk didn't take into account the differentMarc Espie
structure of tmpfs_write. rewrite the opening tests to conform more to ffs's code, so that overrun is not used unitialized. Patch by kettenis@ (on the road) deraadt@ "do it right away"
2014-02-25Check for offset wraparound and enforce RLIMIT_FSIZE.Philip Guenther
problem reported by brad@ ok kettenis@ millert@
2014-01-22bring over kqfilter code from ufs which works better than theTed Unangst
generic flavor. problems noted and tested by ajacoutot
2014-01-07Delay checking the vnode locking of the target vnodes in tmpfs_rename()Philip Guenther
until we've confirmed they're on the same filesystem as the source: not all filesystems do locking the same. problem report and testing chrisz@ ok espie@
2013-12-25zap defines that don't make any sense for usMarc Espie
okay tedu@
2013-12-23sync specvops with ffs (fixing spec_open along the way)Ted Unangst
ok espie
2013-12-23Move KASSERT a bit further down because it can apparently be triggered byMark Kettenis
trying to hardlink a directory. While this is not allowed on tmpfs, this allows us to reach the code that checks for this such that we can return the appropriate error. Cluestick from Pedro Martelletto. ok espie@