summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method.pjd2007-02-1518-146/+154
| | | | | | | | | | | | | | | | This way we may support multiple structures in v_data vnode field within one file system without using black magic. Vnode-to-file-handle should be VOP in the first place, but was made VFS operation to keep interface as compatible as possible with SUN's VFS. BTW. Now Solaris also implements vnode-to-file-handle as VOP operation. VFS_VPTOFH() was left for API backward compatibility, but is marked for removal before 8.0-RELEASE. Approved by: mckusick Discussed with: many (on IRC) Tested with: ufs, msdosfs, cd9660, nullfs and zfs
* Forced commit and #include changes for repo copy fromrodrigc2007-02-117-21/+21
| | | | | | sys/isofs/cd9660 to sys/fs/cd9660. Discussed on freebsd-current.
* Add noatime to the list of mount options that msdosfs accepts.rodrigc2007-02-081-1/+1
| | | | | PR: 108896 Submitted by: Eugene Grosbein <eugen grosbein pp ru>
* Style fixes: use ANSI C function declarations.rodrigc2007-02-081-31/+8
|
* Fix the race of dereferencing /proc/<pid>/file with execve(2) by cachingkib2007-02-071-4/+12
| | | | | | | | | the value of p_textvp. This way, we always unlock the locked vnode. While there, vhold() the vnode around the vn_lock(). Reported and tested by: Guy Helmer (ghelmer palisadesys com) Approved by: des (procfs maintainer) MFC after: 1 week
* Eliminate some dead code which was introduced in 1.23, yet was alwaysrodrigc2007-02-061-11/+0
| | | | commented out.
* coda_vptofh is never defined nor used.pjd2007-02-021-1/+0
|
* Fixing compilation bustage by removing references to opt_msdosfs.h.avatar2007-01-302-4/+0
| | | | | This auto-generated header file no longer exists since the removal of MSDOSFS_LARGE in sys/conf/options:1.574.
* Fix spacing from my previous commit to this file:trhodes2007-01-301-1/+1
| | | | Noticed by: fjoe
* Add a "-o large" mount option for msdosfs. Convert compile-time checks forrodrigc2007-01-302-36/+54
| | | | | | | | | | | | | | | | #ifdef MSDOSFS_LARGE to run-time checks to see if "-o large" was specified. Test case provided by Oliver Fromme: truncate -s 200G test.img mdconfig -a -t vnode -f test.img -u 9 newfs_msdos -s 419430400 -n 1 /dev/md9 zip250 mount -t msdosfs /dev/md9 /mnt # should fail mount -t msdosfs -o large /dev/md9 /mnt # should succeed PR: 105964 Requested by: Oliver Fromme <olli lurza secnetix de> Tested by: trhodes MFC after: 2 weeks
* Below is slightly edited description of the LOR by Tor Egge:kib2007-01-221-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -------------------------- [Deadlock] is caused by a lock order reversal in vfs_lookup(), where [some] process is trying to lock a directory vnode, that is the parent directory of covered vnode) while holding an exclusive vnode lock on covering vnode. A simplified scenario: root fs var fs / A / (/var) D /var B /log (/var/log) E vfs lock C vfs lock F Within each file system, the lock order is clear: C->A->B and F->D->E When traversing across mounts, the system can choose between two lock orders, but everything must then follow that lock order: L1: C->A->B | +->F->D->E L2: F->D->E | +->C->A->B The lookup() process for namei("/var") mixes those two lock orders: VOP_LOOKUP() obtains B while A is held vfs_busy() obtains a shared lock on F while A and B are held (follows L1, violates L2) vput() releases lock on B VOP_UNLOCK() releases lock on A VFS_ROOT() obtains lock on D while shared lock on F is held vfs_unbusy() releases shared lock on F vn_lock() obtains lock on A while D is held (violates L1, follows L2) dounmount() follows L1 (B is locked while F is drained). Without unmount activity, vfs_busy() will always succeed without blocking and the deadlock isn't triggered (the system behaves as if L2 is followed). With unmount, you can get 4 processes in a deadlock: p1: holds D, want A (in lookup()) p2: holds shared lock on F, want D (in VFS_ROOT()) p3: holds B, want drain lock on F (in dounmount()) p4: holds A, want B (in VOP_LOOKUP()) You can have more than one instance of p2. The reversal was introduced in revision 1.81 of src/sys/kern/vfs_lookup.c and MFCed to revision 1.80.2.1, probably to avoid a cascade of vnode locks when nfs servers are dead (VFS_ROOT() just hangs) spreading to the root fs root vnode. - Tor Egge To fix the LOR, ups@ noted that when crossing the mount point, ni_dvp is actually not used by the callers of namei. Thus, placeholder deadfs vnode vp_crossmp is introduced that is filled into ni_dvp. Idea by: ups Reviewed by: tegge, ups, jeff, rwatson (mac interaction) Tested by: Peter Holm MFC after: 2 weeks
* Add a 3rd entry in the cache, which keeps the end positiontrhodes2007-01-162-3/+19
| | | | | | | | | | from just before extending a file. This has the desired effect of keeping the write speed constant. And yes, that helps a lot copying large files always at full speed now, and I have seen improvements using benchmarks/bonnie. Stolen from: NetBSD Reviewed by: bde
* Rewrite the udf_read() routine to use a file vnode instead of the devvp vnode.pav2007-01-151-24/+52
| | | | | | | | | | | | The code is modelled after cd9660, including support for simple read-ahead courtesy of clustered read. Fix udf_strategy to DTRT. This change fixes sendfile(2) not to send out garbage. Reviewed by: scottl MFC after: 1 month
* Tell backing v_object the filesize right on it's creation.pav2007-01-071-1/+6
| | | | MFC after: 1 week
* When performing a mount update to change a mount from read-only to read-write,rodrigc2007-01-061-4/+10
| | | | | | | | | | | | | | | | | | | | | do not call markvoldirty() until the mount has been flagged as read-write. Due to the nature of the msdosfs code, this bug only seemed to appear for FAT-16 and FAT-32. This fixes the testcase: #!/bin/sh dd if=/dev/zero bs=1m count=1 oseek=119 of=image.msdos mdconfig -a -t vnode -f image.msdos newfs_msdos -F 16 /dev/md0 fd120m mount_msdosfs -o ro /dev/md0 /mnt mount | grep md0 mount -u -o rw /dev/md0; echo $? mount | grep md0 umount /mnt mdconfig -d -u 0 PR: 105412 Tested by: Eugene Grosbein <eugen grosbein pp ru>
* Simplify code in union_hashins() and union_hashget() functions. Theserodrigc2007-01-051-24/+12
| | | | | | | functions now more closely resemble similar functions in nullfs. This also eliminates some errors. Submitted by: daichi, Masanori OZAWA <ozawa ongs co jp>
* Eliminate obsolete comment, now that getushort() is implemented inrodrigc2007-01-051-4/+0
| | | | terms of functions in <sys/endian.h>.
* Eliminate ASSERT_VOP_ELOCKED panics when doing mkdir or symlink whenrodrigc2007-01-051-8/+20
| | | | | | sysctl vfs.lookup_shared=1. Submitted by: daichi, Masanori OZAWA <ozawa ongs co jp>
* Use the vnode interlock to close a race where pfs_vncache_alloc() couldjhb2007-01-021-8/+9
| | | | | | | | attempt to vn_lock() a destroyed vnode resulting in a hang. MFC after: 1 week Submitted by: ups Reviewed by: des
* Call vnode_create_vobject() in VOP_OPEN. Makes mmap work on UDF filesystem.pav2006-12-231-0/+12
| | | | | | PR: kern/92040 Approved by: scottl MFC after: 1 week
* Unbreak 64-bit little-endian systems that do require alignment.marcel2006-12-211-18/+5
| | | | | The fix involves using le16dec(), le32dec(), le16enc() and le32enc(). This eliminates invalid casts and duplicated logic.
* For big-endian version of getulong() macro, cast result to u_int32_t.rodrigc2006-12-191-1/+1
| | | | | | | | | | | This macro was written expecting a 32-bit unsigned long, and doesn't work properly on 64-bit systems. This bug caused vn_stat() to return incorrect values for files larger than 2gb on msdosfs filesystems on 64-bit systems. PR: 106703 Submitted by: Axel Gonzalez <loox e-shell net> MFC after: 3 days
* Fix get_ulong() macro on AMD64 (or any little-endian 64-bit platform).rodrigc2006-12-191-5/+1
| | | | | | | | | This bug caused vn_stat() to fail on files larger than 2gb on msdosfs filesystems on AMD64. PR: 106703 Tested by: Axel Gonzalez <loox e-shell net> MFC after: 3 days
* Remove unused variable in unionfs_root().rodrigc2006-12-091-2/+0
| | | | Submitted by: daichi, Masanori OZAWA
* Use vfs_mount_error() in a few places to give more descriptive mount errorrodrigc2006-12-091-2/+6
| | | | messages.
* Add locking around calls to unionfs_get_node_status()rodrigc2006-12-091-0/+4
| | | | | | | in unionfs_ioctl() and unionfs_poll(). Submitted by: daichi, Masanori OZAWA <ozawa@ongs.co.jp> Prompted by: kris
* In unionfs_readdir(), prevent a possible NULL dereference.rodrigc2006-12-091-0/+4
| | | | | CID: 1667 Found by: Coverity Prevent (tm)
* In unionfs_hashrem(), use LIST_FOREACH_SAFE when iterating overrodrigc2006-12-091-2/+3
| | | | | | | the list of nodes to free them. CID: 1668 Found by: Coverity Prevent (tm)
* Minor cleanup. If we are doing a mount update, and we pass inrodrigc2006-12-091-4/+8
| | | | | | | | | | | an "export" flag indicating that we are trying to NFS export the filesystem, and the MSDOSFS_LARGEFS flag is set on the filesystem, then deny the mount update and export request. Otherwise, let the full mount update proceed normally. MSDOSFS_LARGES and NFS don't mix because of the way inodes are calculated for MSDOSFS_LARGEFS. MFC after: 3 days
* The ISO9660 spec does allow files up to 4G. Change the i_sizekientzle2006-12-081-1/+1
| | | | | | | | | | field to "unsigned long" so that it actually works. Thanks to Robert Sciuk for sending me a DVD that demonstrated ISO9660-formatted media with a file >2G. I've now fixed this both in libarchive and in the cd9660 filesystem. MFC after: 14 days
* Threading cleanup.. part 2 of several.julian2006-12-061-10/+3
| | | | | | | | | | | | | | | | | | | | | | Make part of John Birrell's KSE patch permanent.. Specifically, remove: Any reference of the ksegrp structure. This feature was never fully utilised and made things overly complicated. All code in the scheduler that tried to make threaded programs fair to unthreaded programs. Libpthread processes will already do this to some extent and libthr processes already disable it. Also: Since this makes such a big change to the scheduler(s), take the opportunity to rename some structures and elements that had to be moved anyhow. This makes the code a lot more readable. The ULE scheduler compiles again but I have no idea if it works. The 4bsd scheduler still reqires a little cleaning and some functions that now do ALMOST nothing will go away, but I thought I'd do that as a separate commit. Tested by David Xu, and Dan Eischen using libthr and libpthread.
* o Do not leave uninitialized birthtime: in MSDOSFSMNT_LONGNAMEmaxim2006-12-031-2/+4
| | | | | | | | | | | | set birthtime to FAT CTime (creation time) and in the other cases set birthtime to -1. o Set ctime to mtime instead of FAT CTime which has completely different meaning. PR: kern/106018 Submitted by: Oliver Fromme MFC after: 1 month
* Add missing includes for <sys/buf.h> and <sys/bio.h>.rodrigc2006-12-021-0/+2
|
* Many, many thanks to Masanori OZAWA <ozawa@ongs.co.jp>rodrigc2006-12-024-3040/+3216
| | | | | | | | | | | | | and Daichi GOTO <daichi@FreeBSD.org> for submitting this major rewrite of unionfs. This rewrite was done to try to solve many of the longstanding crashing and locking issues in the existing unionfs implementation. This implementation also adds a 'MASQUERADE mode', which allows the user to set different user, group, and file permission modes in the upper layer. Submitted by: daichi, Masanori OZAWA Reviewed by: rodrigc (modified for minor style issues)
* o From the submitter: dos2unixchr will convert to lower case ifmaxim2006-11-261-2/+4
| | | | | | | | | | | | | | | LCASE_BASE or LCASE_EXT or both are set. But dos2unixfn uses dos2unixchr separately for the basename and the extension. So if either LCASE_BASE or LCASE_EXT is set, dos2unixfn will convert both the basename and extension to lowercase because it is blindly passing in the state of both flags to dos2unixchr. The bit masks I used ensure that only the state of LCASE_BASE gets passed to dos2unixchr when the basename is converted, and only the state of LCASE_EXT is passed in when the extension is converted. PR: kern/86655 Submitted by: Micah Lieske MFC after: 3 weeks
* Fix an integer overflow and allow access to files larger than 4GB onle2006-11-203-19/+19
| | | | NTFS.
* Wake up PIOCWAIT handler on the process exit in addition to the stopkib2006-11-171-2/+2
| | | | | | | | | | | events. &p->p_stype is explicitely woken up on process exit for us. Now, truss /nonexistent exits with error instead of waiting until killed by signal. Reported by: Nikos Vassiliadis nvass at teledomenet gr Reviewed by: jhb MFC after: 1 week
* change vop_lock handling to allowing tracking of callers' file and line forkmacy2006-11-133-5/+5
| | | | | | acquisition of lockmgr locks Approved by: scottl (standing in for mentor rwatson)
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-0610-63/+107
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* Create a bidirectional mapping of the DOS 'read only' attributebp2006-11-053-2/+20
| | | | | | | | to the 'w' flag. PR: kern/77958 Submitted by: ghozzy gmail com MFC after: 1 month
* Make KSE a kernel option, turned on by default in all GENERICjb2006-10-261-0/+10
| | | | | | | kernel configs except sun4v (which doesn't process signals properly with KSE). Reviewed by: davidxu@
* Ditch crummy fattime <--> timespec conversion functionsphk2006-10-241-149/+8
|
* Drop crummy fattime to timespec conversion routines.phk2006-10-241-163/+12
| | | | Leave a XXX here for anybody able to test.
* Replace slightly crummy fattime<->timespec conversion functions.phk2006-10-245-180/+16
|
* Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.hrwatson2006-10-222-2/+4
| | | | | | | | | | | | | begun with a repo-copy of mac.h to mac_framework.h. sys/mac.h now contains the userspace and user<->kernel API and definitions, with all in-kernel interfaces moved to mac_framework.h, which is now included across most of the kernel instead. This change is the first step in a larger cleanup and sweep of MAC Framework interfaces in the kernel, and will not be MFC'd. Obtained from: TrustedBSD Project Sponsored by: SPARTA
* Fake the link count until we have no choice but to load data from thetrhodes2006-10-211-1/+1
| | | | | | | MFT. PR: 86965 Submitted by: Lowell Gilbert <lgfbsd@be-well.ilk.org>
* Update the access and modification times for dev while still holdingkib2006-10-201-2/+2
| | | | | | | thread reference on it. Reviewed by: tegge Approved by: pjd (mentor)
* Fix the race between devfs_fp_check and devfs_reclaim. Derefence thekib2006-10-201-5/+9
| | | | | | | | vnode' v_rdev and increment the dev threadcount , as well as clear it (in devfs_reclaim) under the dev_lock(). Reviewed by: tegge Approved by: pjd (mentor)
* Properly lock the vnode around vgone() calls.kib2006-10-184-25/+113
| | | | | | | | | | | Unlock the vnode in devfs_close() while calling into the driver d_close() routine. devfs_revoke() changes by: ups Reviewed and bugfixes by: tegge Tested by: mbr, Peter Holm Approved by: pjd (mentor) MFC after: 1 week
* Use utc_offset() where applicable, and hide the internals of itphk2006-10-022-10/+6
| | | | as static variables.
OpenPOWER on IntegriCloud