summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ext2fs (follow)
Commit message (Collapse)AuthorAgeFilesLines
* make some `struct vops' members explicitly NULL instead of implicitly NULLsemarie2021-03-241-2/+3
| | | | ok mpi@
* spellingjsg2021-03-114-11/+11
|
* ansijsg2021-03-051-3/+2
|
* kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)cheloha2020-06-242-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | time_second(9) and time_uptime(9) are widely used in the kernel to quickly get the system UTC or system uptime as a time_t. However, time_t is 64-bit everywhere, so it is not generally safe to use them on 32-bit platforms: you have a split-read problem if your hardware cannot perform atomic 64-bit reads. This patch replaces time_second(9) with gettime(9), a safer successor interface, throughout the kernel. Similarly, time_uptime(9) is replaced with getuptime(9). There is a performance cost on 32-bit platforms in exchange for eliminating the split-read problem: instead of two register reads you now have a lockless read loop to pull the values from the timehands. This is really not *too* bad in the grand scheme of things, but compared to what we were doing before it is several times slower. There is no performance cost on 64-bit (__LP64__) platforms. With input from visa@, dlg@, and tedu@. Several bugs squashed by visa@. ok kettenis@
* Remove unused "struct proc *" argument from the following functions:mpi2020-02-272-12/+10
| | | | | | | | | | | | | - ufs_chown() & ufs_chmod() - ufs_reclaim() - ext2fs_chown() & ext2fs_chmod() - ntfs_ntget() & ntfs_ntput() - ntfs_vgetex(), ntfs_ntlookup() & ntfs_ntlookupfile() While here use `ap->a_p' directly when it is only required to re-enter the VFS layer in order to help reducing the loop. ok visa@
* struct vops is not modified during runtime so use const which moves eachclaudio2020-01-202-8/+8
| | | | | into read-only data segment. OK deraadt@ tedu@
* Convert struct vfsops initializer to C99 style.bluhm2019-12-261-14/+14
| | | | OK visa@
* Re-enable IO_NOCACHE, and use is in vnd.beck2019-11-271-3/+3
| | | | | | | | | | | | | Ensure that io to a file backing a vnd is IO_SYNC, so IO to a vnd device is both synchronous and not cached in the buffer cache. This allows the "mount" regress to work repeatably, and avoids a situation where when the buffer cache cleaner runs to clear dirty buffers while people are waiting, it actually increases the dirty buffers when the writes to the underlying vnd are also delayed. ok bluhm@
* vinvalbuf(9): tlseep -> tsleep_nsec(9); ok millert@cheloha2019-07-252-6/+6
|
* getblk(9): tsleep(9) -> tsleep_nsec(9); ok visa@cheloha2019-07-194-14/+14
|
* Add more verbose messages about unsupported ext2fs features.kevlo2019-07-013-21/+87
| | | | | | | | | Based on FreeBSD r320578. While here, rename a few macros to make the consisten and keep in sync with Linux upstream. ok kn@
* Move the allocating and freeing of mount points intovisa2018-09-261-3/+2
| | | | | | dedicated functions. OK deraadt@ mpi@
* fix whitespacejsg2018-09-061-15/+15
|
* Drop redundant "node == parent node" checks from VOP_RMDIR()visa2018-06-211-9/+1
| | | | | | implementations. Rely on the VFS layer to do the checking. OK mpi@, helg@
* Make callers of VOP_CREATE(9) and VOP_MKNOD(9) responsible forvisa2018-06-071-8/+3
| | | | | | unlocking the directory vnode. OK mpi@, helg@
* Lock the device vnode when calling vinvalbuf() in ext2fs_reload(),visa2018-05-291-2/+5
| | | | | | just as is done in ffs_reload(). Requested by and OK bluhm@
* Call vput(dvp) in vnode operation functions instead of calling it invisa2018-05-281-8/+11
| | | | | | | the file allocation routine. This allows stepwise changing of the vnode locking discipline. OK mpi@
* When mounting an ext2 filesystem, lock the device vnode for the durationvisa2018-05-281-2/+5
| | | | | | | of the vinvalbuf() call, just like is done by other filesystems. This prevents a kernel panic with VFSLCKDEBUG. OK mpi@
* Drop unnecessary `p' parameter from vget(9).visa2018-05-271-3/+3
| | | | OK mpi@
* Remove proc from the parameters of vn_lock(). The parameter isvisa2018-05-023-15/+12
| | | | | | unnecessary because curproc always does the locking. OK mpi@
* Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is alwaysvisa2018-04-284-20/+20
| | | | | | | curproc that does the locking or unlocking, so the proc parameter is pointless and can be dropped. OK mpi@, deraadt@
* Mark ext2fs inode recursive lock as RWL_IS_VNODE like for ffs to let itmpi2018-03-281-2/+2
| | | | | | play with WITNESS. ok visa@
* "force dirty" printf's are no longer required when pushing filesystemsderaadt2018-03-151-1/+3
| | | | safely to disk. The subsystem seems to be working as intended! :)
* Syncronize filesystems to disk when suspending. Each mountpoint's vnodesderaadt2018-02-102-13/+49
| | | | | | | | | | 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.
* In ext2fs_write(), clear the buffer on uiomove() failure unless itmillert2018-01-131-1/+13
| | | | was cleared on alloc just like we do in ffs_write().
* Pass correct size to uvm_vnp_setsize() for large files.millert2018-01-081-2/+2
|
* Add kqueue support for ext2fs based on ffs. OK deraadt@millert2018-01-082-5/+10
|
* Don't pull in <sys/file.h> just to get fcntl.hguenther2017-12-302-4/+4
| | | | ok deraadt@ krw@
* Delete unnecessary <sys/file.h> includesguenther2017-12-301-2/+1
| | | | ok millert@ krw@
* In uvm Chuck decided backing store would not be allocated proactivelyderaadt2017-12-111-10/+8
| | | | | | | | | | | | | | | | | | | | | | 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
* If you use sys/param.h, you don't need sys/types.hderaadt2017-09-081-1/+0
|
* ext2fs: Mark superblock as not modified when writtensf2017-05-301-1/+2
| | | | | | | | I have seen spurious "file system not clean; please fsck(8)" warnings during "mount -ur". Set e2fs_fmod = 0 when writing the superblock (as ffs does). "Makes sense" deraadt@
* Tweak lock inits to make the system runnable with witness(4)visa2017-04-201-2/+2
| | | | on amd64 and i386.
* all pools have their ipl set via pool_setipl, so fold it into pool_init.dlg2016-09-151-7/+5
| | | | | | | | | | | | | | | | | | | | | | 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);
* Remove usermount remnants. ok tedunatano2016-09-071-29/+1
|
* Missed a couple qaddr_t castsguenther2016-08-131-2/+2
|
* ext2fs only has one set of specops/fifoopsnatano2016-08-103-13/+8
| | | | ok mpi tedu
* Remove the lockmgr() API. It is only used by filesystems, where it is anatano2016-06-191-2/+2
| | | | | | | | 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
* add pool_setipl on all pools.dlg2016-06-191-1/+3
| | | | ok tedu@ visa@
* Unsigned integers can't be negative.natano2016-06-032-6/+2
| | | | | from David Hill and mmcc@ ok stefan
* When pulling an msdos formated umass stick during mount while thebluhm2016-05-221-1/+3
| | | | | | | | | | usb stack was busy, the kernel could trigger an uvm fault. There is a race between vop_generic_revoke() and sys_mount() where vgonel() could reset v_specinfo. Then v_specmountpoint is no longer valid. So after sleeping, msdosfs_mountfs() could crash in the error path. The code in the different *_mountfs() functions was inconsistent, implement the same check everywhere. OK krw@ natano@
* Pad struct ext2fs out to 1024 (a.k.a. ext2fs SBSIZE) bytes. Satisfieskrw2016-04-271-3/+3
| | | | | | | | | assumptions in fsck_ext2fs and eliminates spurious "VALUES IN SUPER BLOCK DISAGREE WITH THOSE IN FIRST ALTERNATE" messages. Part of the problem reported to bugs@ by Lampshade. ok beck@
* Populate all necessary statfs members in .vfs_statfs. cd9660, udf,natano2016-04-261-8/+6
| | | | | | | | | | 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
* When pulling and unmounting an umass USB stick, the file systembluhm2016-03-271-3/+3
| | | | | | | | | | | | 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@
* Remove the unused flags argument from VOP_UNLOCK().natano2016-03-194-22/+22
| | | | | | torture tested on amd64, i386 and macppc ok beck mpi stefan "the change looks right" deraadt
* Set mnt_data to NULL after freeing the file system specific mount point.bluhm2016-03-171-3/+3
| | | | OK krw@ natano@ as part of a larger diff
* Change a bunch of (<blah> *)0 to NULL.krw2016-03-141-2/+2
| | | | ok beck@ deraadt@
* *** empty log message ***natano2016-03-011-9/+6
|
* Move mnt_maxsymlink from struct mount to struct ufsmount.natano2016-02-274-15/+9
| | | | | | | | | | | | | | The concept of differentiating between "short" and "long" symlinks is specific to ufs/, so it shouldn't creep into the generic fs layer. Inspired by a similar commit to NetBSD. While there replace all references to mnt_maxsymlinklen in ufs/ext2fs with EXT2_MAXSYMLINKLEN, which is the constant max short symlink len for ext2fs. This allows to get rid of some (mnt_maxsymlinklen == 0) checks there, which is always false for ext2fs. input and ok stefan@ ok millert@
* Convert mnt_maxsymlinklen to unsigned.natano2016-02-262-4/+4
| | | | | | | | This allows to remove some truncating casts in symlink handling code. Also, validate fs_maxsymlinklen in the superblock at mount time and on fsck to make sure we don't use bogus data. discussion & ok millert@, stefan@