summaryrefslogtreecommitdiffstats
path: root/sys/msdosfs/msdosfs_vfsops.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Drop unnecessary `p' parameter from vget(9).visa2018-05-271-2/+2
| | | | OK mpi@
* Remove proc from the parameters of vn_lock(). The parameter isvisa2018-05-021-5/+5
| | | | | | unnecessary because curproc always does the locking. OK mpi@
* Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is alwaysvisa2018-04-281-5/+5
| | | | | | | curproc that does the locking or unlocking, so the proc parameter is pointless and can be dropped. OK mpi@, deraadt@
* Syncronize filesystems to disk when suspending. Each mountpoint's vnodesderaadt2018-02-101-4/+5
| | | | | | | | | | 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.
* Don't pull in <sys/file.h> just to get fcntl.hguenther2017-12-301-2/+2
| | | | ok deraadt@ krw@
* In uvm Chuck decided backing store would not be allocated proactivelyderaadt2017-12-111-17/+15
| | | | | | | | | | | | | | | | | | | | | | 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
* msdosfs & ffs: flush cache if updating mount from r/w to r/osf2017-05-291-2/+9
| | | | ok deraadt@
* Rename BIOS parameter block field from bsPBP to bsBPB. This typobluhm2016-10-101-2/+2
| | | | | has been fixed in FreeBSD in 2002. No binary change. From Alexander von Gernler; OK krw@
* Do not check the SecPerTrack field of the BPB when mounting a MSDOSbluhm2016-10-091-2/+2
| | | | | | | file system. In modern images the field is not set properly and the value is not used anyway. FreeBSD has removed the check already in 2008. From Alexander von Gernler; OK krw@
* Kill empty ifdef; ok fcambus@jca2016-09-281-3/+1
|
* Remove usermount remnants. ok tedunatano2016-09-071-32/+3
|
* Eliminate pointless casts to qaddr_t of a value being assigned to a void*guenther2016-08-131-2/+2
| | | | ok kettenis@ krw@ natano@ dlg@ espie@
* When pulling an msdos formated umass stick during mount while thebluhm2016-05-221-2/+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@
* Populate all necessary statfs members in .vfs_statfs. cd9660, udf,natano2016-04-261-9/+9
| | | | | | | | | | 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-4/+4
| | | | | | | | | | | | 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-191-7/+7
| | | | | | 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
* Fix printf() types so kernel compiles with or w/o MSDOSFS_DEBUG.krw2015-10-231-3/+3
| | | | | e.g. print pointers with %p instead of %08x. No changes outside of MSDOSFS_DEBUG.
* Nuke a bunch of leading/embedded/trailing whitespace so the code can bekrw2015-10-231-14/+14
| | | | read without generating spurious headaches.
* Include sys/stdint.h for SIZE_MAX instead of relying on the misplacedmillert2015-02-131-1/+2
| | | | define in sys/limits.h. OK guenther@
* primary change: move uvm_vnode out of vnode, keeping only a pointer.tedu2014-12-161-1/+2
| | | | | | 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
* More malloc() -> mallocarray() in the kernel.doug2014-12-091-2/+2
| | | | ok deraadt@ tedu@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-5/+5
| | | | after discussions with beck deraadt kettenis.
* Fix possible crash on invalid filesystems.tobias2014-06-231-2/+3
| | | | | | Merged from FreeBSD's revision 206098. ok beck@
* Fix off by one in pm_inusemap.tobias2014-06-181-2/+2
| | | | | | | 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@
* Fix 'mount -ur' for msdosfssf2014-05-271-1/+7
| | | | | | | * fix bug preventing sync after more than one rw -> ro cycle. * sync data and not only metadata ok guenther@
* stop using B_AGE, it was effectively retired some time ago.tedu2014-05-091-2/+1
|
* Add an f_mntfromspec member to struct statfs, which specifies the name ofjsing2013-04-151-4/+9
| | | | | | | | | | | | | 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@
* Cleanup VFS mount string handling:jsing2012-09-101-13/+10
| | | | | | | | | | | - Avoid using copyinstr() without checking the return value. - sys_mount() has already copied the path in, so pass this to the filesystem mount code so that it does not have to copy it in again. - Avoid copyinstr()/bzero() dance when we can simply bzero() and strlcpy(). ok krw@
* move the specfs code to a place people can see it; ok guenther thib krwderaadt2011-07-041-2/+2
|
* bread does nothing with its ucred argument. remove it. ok matthewtedu2011-07-041-3/+3
|
* Teach msdosfs_mount() how to handle disklabel UIDs.jsing2010-11-171-22/+45
|
* Change:oga2010-09-231-5/+3
| | | | | | | | | | | | | | | | | /* something */ if (error) { VOP_UNLOCK(); return; } VOP_UNLOCK(); to the clearer and shorter: VOP_UNLOCK(); if (error) return; ok thib@, jsing@ as part of a larger diff.
* "Fix" crash caused by FAT32 re-use of small buf from buffer cache,krw2010-01-241-1/+3
| | | | | | | | | | at least until problem (starting somewhere between 4.1 and 4.2) in buffer cache is found and a general fix is in place. Simply B_INVAL small buf so it doesn't come back. Addresses PR#6290, confirmed by submitter RD Thrush. ok tedu@ "should be marked XXX" thib@
* Re-introduce the remaining bits of thib@'s Aug 2006 VOP_CLOSE()krw2009-12-191-1/+5
| | | | | | | locking fixes. Tweak cd9660 code to be the same as everywhere else, no functional change. ok beck@
* Use suser when possible. Suggested by miod@.fgsch2009-10-311-3/+3
| | | | miod@ deraadt@ ok.
* lock the vnode before calling VOP_CLOSE() in msdofs_unmount().thib2009-08-301-2/+3
| | | | ok krw@
* - deregister; no binary changejasper2009-08-141-3/+3
| | | | ok thibski@
* - ansify function declarations, no binary changejasper2009-08-131-44/+14
| | | | "fine" thib@
* The FAT32 fsinxtfree field is advisory in nature and we don't usekrw2009-01-051-2/+3
| | | | | | | | | | | it. So leave it untouched. Similiar to but more ruthless than the fixes FreeBSD did, since they do use the value. Basically avoid various off-by-one and off-by-many errors. Fixes problems encountered by jsg@ and deraadt@ where filesystems found on SDHC cards caused UVM faults. Original fixes found by jsg@. ok jsg@.
* Fix jsg@'s iRiver Clix by relaxing the test for SecPerTrack to allowkrw2007-11-261-2/+2
| | | | | | 64 instead of 63. deraadt@, weingart@, millert@, thib@, miod@ ok with eliminating test entirely but tom@'s voice of caution wins out for the quick commit. Tested by jsg@ to confirm it fixes his device.
* read boot sector as 4K block, because of new ipod nanoderaadt2007-11-151-2/+2
| | | | from Alexey Vatchenko; ok tom
* Only the most obvious bzero() -> M_ZERO changes. No cast changes, nokrw2007-09-171-3/+2
| | | | | MALLOC/FREE, etc. Just adding M_ZERO to malloc() and deleting an immediately adjacent bzero().
* Remove the v_interlock simplelock from the vnode structure.thib2007-03-211-3/+2
| | | | | | | | | Zap all calls to simple_lock/unlock() on it (those calls are #defined away though). Remove the LK_INTERLOCK from the calls to vn_lock() and cleanup the filesystems wich implement VOP_LOCK(). (by remvoing the v_interlock from there calls to lockmgr()). ok pedro@, art@, tedu@
* Adopt FreeBSD's code for non-DEV_BSIZE formatted MSDOSFS filesystems.krw2006-12-161-11/+34
| | | | | | | | | Enables devices (e.g. newer iPods, various other mp3 players) that use 2048 byte sectors. Inspired by original diffs from weingart@ and Alexey Vatchenk. ok tom@ pedro@ deraadt@ weingart@ marco@
* Nuke GEMDOSFS. Unused part of unused atari port. Simplifieskrw2006-12-151-94/+5
| | | | | | | | MSDOSFS code. Eliminates -G option to mount_msdos. Nit detection by gwk@, tom@, jmc@. ok weingart@ tom@ thib@ dlg@ deraadt@
* Remove dirsperblk, which is not used after it is calculated.tom2006-12-141-4/+1
| | | | ok weingart@ pedro@
* If an MS-DOS filesystem claims to have more clusters than can betom2006-12-141-1/+25
| | | | | | | | | | | represented in the FAT, limit the number of clusters we work with to the FAT value. This stops corrupt filesystems causing us to run off the end of the FAT and panic()ing in fillinusemap(). Found by Jason Crawford (jasonrcrawford at gmail.com) with the MOKB fs fuzzer. Initial debugging by thib@. ok krw@
* detect potential multiplicative overflow before allocation, and return viaderaadt2006-11-291-6/+10
| | | | the error path; ok pedro
* Fix malloc() panic in msdosfs_mountfs(), okay thib@ deraadt@pedro2006-11-261-2/+6
| | | | Found using fuzz generator written by lmh@info-pull.com