summaryrefslogtreecommitdiff
path: root/sys/msdosfs
AgeCommit message (Collapse)Author
2016-09-07Remove usermount remnants. ok teduMartin Natano
2016-08-30Revert "Implement VFS read clustering for MSDOSFS"Stefan Fritsch
This caused garbage to be written instead of blocks of 0-bytes if a file is extended by seeking past the end. This happens for example when extracting files containing lots of 0-bytes with tar. ok mpi@ Details of original commit: msdosfs_vnops.c revision 1.105 denode.h revision 1.28 date: 2016/01/13 10:00:55; author: mpi; commitid: ru9jHQwQX09BC5Bw; Implement VFS read clustering for MSDOSFS. The logic used in msdosfs_bmap() to loop calling pcbmap() comes from FreeBSD and is not really efficient but it is good enough since it is only called when generating I/O. With this diff I get a 100% improvement when reading big files from a crappy USB stick. With this and bread_cluster(9) modified to not re-fetch B_CACHED buffers, reading large contiguous files with chunk sizes of MAXPHYS is almost as fast as physio(9) on the same device. For a 'real world' example, when copying music files from a USB stick I see a speed jump from 15MB/s on -current to 24Mb/s with this diff. While here rename some 'lbn' variables into 'cn' to better reflect what we're dealing with. Tested by Mathieu, with support from deraadt@
2016-08-13Eliminate pointless casts to qaddr_t of a value being assigned to a void*Philip Guenther
ok kettenis@ krw@ natano@ dlg@ espie@
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-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-21Remove the -x flag from mount_msdos and always assume the execute bitMartin Natano
for readable directories, while making it subject to the mask option (-m in mount_msdos), so it is still possible to mount with non-executable directories, but with semantics that are easier to comprehend. This makes directory listings with default mount options work again. ok deraadt@
2016-05-21by default, files were made executable. that does not make sense today.Theo de Raadt
noone should be executing a binary from a msdos filesystem, considering the mountpoint tracking permission mode model ok natano krw
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-03-14Change a bunch of (<blah> *)0 to NULL.Kenneth R Westerback
ok beck@ deraadt@
2016-02-05Guard against integer overflow when checking whetherStefan Kempf
writing to a file on msdosfs stays within the max. file size. ok kettenis@, krw@
2016-01-27Convert min + uiomovei to ulmin + uiomove.Stefan Kempf
From Martin Natano.
2016-01-13Implement VFS read clustering for MSDOSFS.Martin Pieuchot
The logic used in msdosfs_bmap() to loop calling pcbmap() comes from FreeBSD and is not really efficient but it is good enough since it is only called when generating I/O. With this diff I get a 100% improvement when reading big files from a crappy USB stick. With this and bread_cluster(9) modified to not re-fetch B_CACHED buffers, reading large contiguous files with chunk sizes of MAXPHYS is almost as fast as physio(9) on the same device. For a 'real world' example, when copying music files from a USB stick I see a speed jump from 15MB/s on -current to 24Mb/s with this diff. While here rename some 'lbn' variables into 'cn' to better reflect what we're dealing with. Tested by Mathieu, with support from deraadt@
2015-10-23Fix renaming in the root directory by correctly setting directoryKenneth R Westerback
offset. From Serguey Parkhomovsky via bugs@, in response to problem report from matthieu@. Same fix is in NetBSD for one. ok tedu@
2015-10-23Fix printf() types so kernel compiles with or w/o MSDOSFS_DEBUG.Kenneth R Westerback
e.g. print pointers with %p instead of %08x. No changes outside of MSDOSFS_DEBUG.
2015-10-23Nuke a bunch of leading/embedded/trailing whitespace so the code can beKenneth R Westerback
read without generating spurious headaches.
2015-09-23remove lockmgr_printinfo stubs. from Martin NatanoTed 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-13Include sys/stdint.h for SIZE_MAX instead of relying on the misplacedTodd C. Miller
define in sys/limits.h. OK guenther@
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-09rename desiredvnodes to initialvnodes. less of a lie. ok beck deraadtTed Unangst
2014-12-19Use <sys/endian.h> instead of <machine/endian.h>Philip Guenther
ok dlg@ mpi@ bcook@ millert@ miod@
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-09More malloc() -> mallocarray() in the kernel.Doug Hogan
ok deraadt@ tedu@
2014-11-18use siphash for key lookups in all the filesystem hashes.David Gwynne
ok deraadt@ tedu@
2014-11-03include sys/unistd.h where needed instead of indirect reliance. ok jsgTed Unangst
2014-09-14remove uneeded proc.h includesJonathan Gray
ok mpi@ kspillner@
2014-08-10fix kqueue read/write filters for msdosfs and fusefsJonathan Gray
ok tedu@
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-06-23Fix possible crash on invalid filesystems.Tobias Stoeckmann
Merged from FreeBSD's revision 206098. ok beck@
2014-06-18Fix off by one in pm_inusemap.Tobias Stoeckmann
FreeBSD did this years ago in revision 126086 as pointed out by John-Mark Gurney on tech. Merge it and sync two occurrences. ok krw@
2014-05-27Fix 'mount -ur' for msdosfsStefan Fritsch
* fix bug preventing sync after more than one rw -> ro cycle. * sync data and not only metadata ok guenther@
2014-05-09stop using B_AGE, it was effectively retired some time ago.Ted Unangst
2014-05-09disable IO_NOCACHE B_NOCACHE conversion until it works.Ted Unangst
2014-04-21msdosfs timestamps can only represent 1/1/1980 throughKenneth R Westerback
12/31/2107. 64-bit time_t now dominates that entire range, so simply set all dates that cannot be represented to 1/1/1980 like Redmond intended. Problem reported by Alessandro De Laurenzis via misc@. ok guenther@
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@
2013-12-24fix error checking oddity in msdosfs code, as noted by kettenis@Alexander Hall
ok mikeb@ espie@
2013-12-14Zero out dirent structures that will be copied out to avoid leaking garbagePhilip Guenther
in the padding or trailing name bytes. ok beck@ millert@ espie@
2013-10-01Format string fixes: %hu/%hd for uint16_t, %u/%d/%x for uint32_tStefan Fritsch
- despite the name, ntohl returns uint32_t, not long - also fix some %d into %u
2013-09-14Correct the handling of I/O of >=2^32 bytes and the ktracing there ofPhilip Guenther
by using size_t/ssize_t instead of int/u_int to handle I/O lengths in uiomove(), vn_fsizechk(), and ktrgenio(). Eliminate the always-zero 'error' argument to ktrgenio() at the same time.
2013-08-13Switch time_t, ino_t, clock_t, and struct kevent's ident and dataPhilip Guenther
members to 64bit types. Assign new syscall numbers for (almost all) the syscalls that involve the affected types, including anything with time_t, timeval, itimerval, timespec, rusage, dirent, stat, or kevent arguments. Add a d_off member to struct dirent and replace getdirentries() with getdents(), thus immensely simplifying and accelerating telldir/seekdir. Build perl with -DBIG_TIME. Bump the major on every single base library: the compat bits included here are only good enough to make the transition; the T32 compat option will be burned as soon as we've reached the new world are are happy with the snapshots for all architectures. DANGER: ABI incompatibility. Updating to this kernel requires extra work or you won't be able to login: install a snapshot instead. Much assistance in fixing userland issues from deraadt@ and tedu@ and build assistance from todd@ and otto@
2013-06-11final removal of daddr64_t. daddr_t has been 64 bit for a long enoughTheo de Raadt
test period; i think 3 years ago the last bugs fell out. ok otto beck others
2013-05-23revoke's default imp works.Marc Espie
okay tedu@
2013-04-15Add an f_mntfromspec member to struct statfs, which specifies the name ofJoel Sing
the special provided when the mount was requested. This may be the same as the special that was actually used for the mount (e.g. in the case of a device node) or it may be different (e.g. in the case of a DUID). Whilst here, change f_ctime to a 64 bit type and remove the pointless f_spare members. Compatibility goo courtesy of guenther@ ok krw@ millert@
2013-03-28Add support for _PC_TIMESTAMP_RESOLUTION for ffs/mfs, cd9600, ext2,Philip Guenther
msdos, NFS, fifos and devices, plus support for querying it in getconf(2) and the requisite pathconf(2) manpage blurb ok tedu@
2013-03-28Handle the pathconf _PC_PATH_MAX, _PC_PIPE_BUF, _PC_ASYNC_IO,Philip Guenther
_PC_PRIO_IO, and _PC_SYNC_IO names in VOP_PATHCONF(), as they're fs-independent for us. Since we don't support latter three on any fs, we can also define the related _POSIX_{ASYNC,PRIO,SYNC}_IO symbols in <unistd.h> (via sys/unistd.h) with value -1. Also, zap pointless tty-only values from procfs(!). ok beck@, deraadt@