summaryrefslogtreecommitdiff
path: root/sys/ufs/ffs
AgeCommit message (Collapse)Author
2017-05-29msdosfs & ffs: flush cache if updating mount from r/w to r/oStefan Fritsch
ok deraadt@
2017-04-20Tweak lock inits to make the system runnable with witness(4)Visa Hankala
on amd64 and i386.
2016-11-27Fix signedness warnings with careful casts and replace a re-defined variable.Reyk Floeter
(Missed this chunk as part of previous commit to libsa/ufs.c) OK krw@
2016-11-07Split PID from TID, giving processes a PID unrelated to the TID of theirPhilip Guenther
initial thread ok jsing@ kettenis@
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-09-10Add a noperm mount flag for FFS to be used for building release setsMartin Natano
without root privileges. This is only the kernel/mount flag; additional work in the build Makefile's will be necessary such that the files in $DESTDIR are created with correct permissions. tedu couldn't find anything wrong with it in a quick review idea & ok deraadt
2016-09-07Remove usermount remnants. ok teduMartin Natano
2016-08-13Missed a couple qaddr_t castsPhilip Guenther
2016-08-10fix previous; ffs_vinit() requires #ifdef _KERNEL to not break theMartin Natano
sbin/fsck_ffs build. bad natano! reported by naddy
2016-08-10ufs_vinit() should really be called ffs_vinit(); it's only called fromMartin Natano
ffs code. ok mpi tedu
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-06-19add pool_setipl on all pools.David Gwynne
ok tedu@ visa@
2016-05-23Use arc4random_uniform() instead of arc4random() to avoid modulus bias.Theo Buehler
This eliminates the idiom 'arc4random() % X' (where X + 1 is not a power of two) from base. Part of a patch from Matthew Martin from end of last year. ok tedu@ (a long time ago), natano@
2016-05-23VOP_REALLOCBLKS() and related code is unused since the removal ofMartin Natano
cluster_write(). ok beck zhuk
2016-05-22When pulling an msdos formated umass stick during mount while theAlexander Bluhm
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@
2016-05-10FFS2 does lazy inode initialization, so try harder to avoid usingKenneth R Westerback
random data on the disk as an inode. Thus avoiding crashes when translating a bogus filehandle to a vnode. Yes, I'm looking at you, NFS! Adapted from a diff by Christos Zoulas via NetBSD, pointed out by kurt@. ok beck@
2016-04-07Always call bread_cluster() instead of calling it only if the currentMartin Pieuchot
logical block is contiguous to the previous one. This logic is a left-over of the pre-bread_cluster() area. When the read-ahead version of bread(9) was used to prefetch blocks. Nowadays bread_cluster() do the right thing (tm). 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-03-01*** empty log message ***natano
2016-02-27Move mnt_maxsymlink from struct mount to struct ufsmount.natano
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@
2016-02-26Convert mnt_maxsymlinklen to unsigned.natano
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@
2016-02-16Convert to uiomove. From Martin Natano.Stefan Kempf
2016-01-12Remove the "doclusterread" and "doclusterwrite" buttons.Martin Pieuchot
Cluster read is unconditionnally enabled for FFS since some years and toggling "doclusterread" has no effect. OpenBSD no longer support write clustering since the Dynamic Buffer Cache went in, so there is reason to delay the call to bawrite(9). Tested by Mathieu, ok dlg@
2015-11-28move buffer size adjustment to buf_adjcnt - from Walter NetoBob Beck
ok mpi@
2015-09-27lint is dead: delete the trivial uses of /* VARARGS[0-9]+ */Philip Guenther
(others require more care)
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-20MAXFRAG was always placed incorrectly in <sys/param.h> It is primarilyTheo de Raadt
used in disklabel type tools, newfs, fsck, when related to ufs or ufs-derived filesystems, but also in a struct. Those things always include <ufs/ffs/fs.h>. Move it there ok guenther, tested in ports by sthen
2015-01-09rename desiredvnodes to initialvnodes. less of a lie. ok beck deraadtTed Unangst
2014-12-29Explicitely include <uvm/uvm_extern.h> in order to build on variable page sizeMiod Vallat
architectures.
2014-12-23change pool_init allocator to NULL and pass PR_WAITOK in flags as a signTed Unangst
that these don't need to support interrupts
2014-12-12free correct size. it's variable!Ted Unangst
2014-12-12sizeof(*ptr) for some free()Ted Unangst
2014-11-18use siphash for key lookups in all the filesystem hashes.David Gwynne
ok deraadt@ tedu@
2014-11-18move arc4random prototype to systm.h. more appropriate for most codeTed Unangst
to include that than rdnvar.h. ok deraadt dlg
2014-09-14remove uneeded proc.h includesJonathan Gray
ok mpi@ kspillner@
2014-07-14revert free checks in here. this seems to be a bit too agressive at theBob Beck
moment and now is not the time. hitting these in here causes chaos. We need to do these, but at a better time than right after a hackathon and before release. ok guenther@
2014-07-13pass correct sizes to free()Ted 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-05-29fsck should use the same values in checking as newfs does in creatingKenneth R Westerback
a filesystem. fs_nspf and its derivitives like fs_spc are DEV_BSIZE values, not actual hardware disk sector values. Adjust initializations accordingly. Tweak header and man page comments to make the DEV_BSIZE'ness more obvious for future spelunkers. No-op for DEV_BSIZE (a.k.a. 512-byte) sector devices but should help checking filesystems on, e.g., 4k-byte sector devices. ok jmc@ on the man page tweaks.
2014-05-22From FreeBSD: the second argument to UFS_UPDATE/ffs_update is just aPhilip Guenther
boolean, not a MNT_* flag. ok beck@
2014-05-09disable IO_NOCACHE B_NOCACHE conversion until it works.Ted Unangst
2014-04-22Fix issue where we could jump into getdirtybuf without splbio() on a retryBob Beck
that probably crashed espie. ok tedu@
2014-04-08add IO_NOCACHE flag to vop_write arguments, which in turn sets B_NOCACHEBob Beck
on the written buffers. Use the flag for writes from the page daemon to ensure that we free buffers written out by the page daemon rather than caching them. ok kettenis@
2014-03-19Pull in FreeBSD r37363 and r37887:Philip Guenther
-- Sync timestamp changes for inodes of special files to disk as late as possible (when the inode is reclaimed). Temporarily only do this if option UFS_LAZYMOD configured and softupdates aren't enabled. UFS_LAZYMOD is intentionally left out of /sys/conf/options. This is mainly to avoid almost useless disk i/o on battery powered machines. It's silly to write to disk (on the next sync or when the inode becomes inactive) just because someone hit a key or something wrote to the screen or /dev/null. -- Made lazy syncing of timestamps for special files non-optional. -- Also, include support in 'pstat -v' to display the IN_LAZYMOD flag. ok tedu@ millert@
2014-02-04reduce the length of some pool names. ok deraadt guenther mpiTed Unangst
2014-01-25ufs_setattr() was assuming that the flag bits that indicatePhilip Guenther
atime/mtime/ctime need to be updated weren't already set. When they are, the code will end up treating the VNOVAL value from the VFS layer as a time_t. Port the fix from FreeBSD: the critical bit is to process the existing flag values before possibly setting them again in ufs_setattr(). This diff pulls in a larger change from FreeBSD to replace the macro ITIMES() with a function ufs_itimes() and to remove the atime and mtime arguments from ffs_update(): only ufs_setattr() used them so it makes more sense to just do the those bits directly there. tweaks and ok tedu@ matthew@