summaryrefslogtreecommitdiffstats
path: root/sys/ufs
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate inconsistency in the setting of the B_DONE flag. Specifically,alc2005-07-201-1/+1
| | | | | | | | | | | | | | | | make the b_iodone callback responsible for setting it if it is needed. Previously, it was set unconditionally by bufdone() without holding whichever lock is shared by the b_iodone callback and the corresponding top-half function. Consequently, in a race, the top-half function could conclude that operation was done before the b_iodone callback finished. See, for example, aio_physwakeup() and aio_fphysio(). Note: I don't believe that the other, more widely-used b_iodone callbacks are affected. Discussed with: jeff Reviewed by: phk MFC after: 2 weeks
* Allow EVFILT_VNODE events to work on every filesystem type, not justssouhlal2005-06-092-129/+2
| | | | | | | | | | | | | | | UFS by: - Making the pre and post hooks for the VOP functions work even when DEBUG_VFS_LOCKS is not defined. - Moving the KNOTE activations into the corresponding VOP hooks. - Creating a MNTK_NOKNOTE flag for the mnt_kern_flag field of struct mount that permits filesystems to disable the new behavior. - Creating a default VOP_KQFILTER function: vfs_kqfilter() My benchmarks have not revealed any performance degradation. Reviewed by: jeff, bde Approved by: rwatson, jmg (kqueue changes), grehan (mentor)
* This patch addresses a standards violation issue. The standards say akensmith2005-05-311-0/+11
| | | | | | | | | | | | | | | | | | | | | | file's access time should be updated when it gets executed. A while ago the mechanism used to exec was changed to use a more mmap based mechanism and this behavior was broken as a side-effect of that. A new vnode flag is added that gets set when the file gets executed, and the VOP_SETATTR() vnode operation gets called. The underlying filesystem is expected to handle it based on its own semantics, some filesystems don't support access time at all. Those that do should handle it in a way that does not block, does not generate I/O if possible, etc. In particular vn_start_write() has not been called. The UFS code handles it the same way as it would normally handle the access time if a file was read - the IN_ACCESS flag gets set in the inode but no other action happens at this point. The actual time update will happen later during a sync (which handles all the necessary locking). Got me into this: cperciva Discussed with: a lot with bde, a little with kan Showed patches to: phk, jeffr, standards@, arch@ Minor discussion on: arch@
* - Don't set our bio op to be a READ when we've just completed a write. Therejeff2005-05-301-10/+10
| | | | | | | | | are subtle differences in the read and write completion path. Instead, grab an extra write ref so the write path can drop it when we recursively call bufdone(). I believe this may be the source of the wrong bufobj panics. Reported by: pho, kkenn
* Allow removal of empty directories with high link counts. These canmckusick2005-05-181-3/+2
| | | | | | | | | occur on a filesystem running with soft updates after a crash and before a background fsck has been run. To prevent discrepancies from arising in a background fsck that may already be running, the directory is removed but its inode is not freed and is left with the residual reference count. When encountered by the background fsck it will be reclaimed.
* - Don't restrict the softdep stats to DEBUG kernels, they cost nothing tojeff2005-05-031-11/+7
| | | | | | | | | export. This was happening anyway since this file manually sets DEBUG. - Add a sysctl for the number of items on the worklist. - Use a more canonical loop restart in softdep_fsync_mountdev, it saves some code at the expense of a goto and makes me worry less about modifying a variable that should be private to the TAILQ_FOREACH_SAFE macro.
* - Use bdone() directly instead of calling it indirectly throughjeff2005-04-301-11/+1
| | | | | | ffs_rawreaddone(). Sponsored by: Isilon Systems, Inc.
* - Plug memory leak.pjd2005-04-161-3/+10
| | | | | | | | - Fix two style nits. Found by: Coverity Prevent analysis tool Reviewed by: rwatson MFC after: 1 week
* - Change all filesystems and vfs_cache to relock the dvp once the child isjeff2005-04-131-3/+2
| | | | | | locked in the ISDOTDOT case. Se vfs_lookup.c r1.79 for details. Sponsored by: Isilon Systems, Inc.
* - Consistently call 'vp' vp rather than ovp sometimes in ffs_truncate().jeff2005-04-051-105/+104
| | | | | | Do the same for oip. Pointed out by: glebius
* - Use M_ZERO rather than explicitly calling bzero().jeff2005-04-031-13/+13
| | | | | | | | | - Don't intermingle direct calls to lockmgr and indirect calls through VOPs. This will be important in the future. - Dont lock the devvp's interlock just to release it on the next line by passing LK_INTERLOCK to lockmgr. - Restructure ffs_snapshot_unmount so we don't call free() with the devvp's interlock locked.
* - In ffs_sync we need to pass LK_SLEEPFAIL in when we lock the vnodejeff2005-04-031-4/+3
| | | | | | | because it may change identities while we're sleeping on the lock. Otherwise we may bail out of ffs_sync() early due to an error from deadfs. - Collapse a VOP_UNLOCK, vrele into a single vput().
* - Move the contents of softdep_disk_prewrite into ffs_geom_strategy to fixjeff2005-04-033-32/+21
| | | | | | | | | | | | | | | | | two bugs. - ffs_disk_prewrite was pulling the vp from the buf and checking for COPYONWRITE, when really it wanted the vp from the bufobj that we're writing to, which is the devvp. This lead to us skipping the copy on write to all file data, which significantly broke snapshots for the last few months. - When the SOFTUPDATES option was not included in the kernel config we would also skip the copy on write check, which would effectively disable snapshots. - Remove an invalid mp_fixme(). Debugging tips from: mckusick Reported by: iedowse, others Discussed with: phk
* - Fix botched LK_NOWAIT removal. I mistakenly thought this compiled asjeff2005-03-311-1/+1
| | | | part of GENERIC.
* - FFS supports shared locks, clear LK_NOSHARE from our vnode locks.jeff2005-03-311-1/+2
| | | | Sponsored by: Isilon Systems, Inc.
* - Set LK_NOSHARE for snapshot locks. snapshots require exclusive onlyjeff2005-03-312-22/+2
| | | | | | | | access. - Remove the hack from ffs_lock() to implement LK_NOSHARE in a ffs specific way. Sponsored by: Isilon Systems, Inc.
* - LK_NOPAUSE is a nop now.jeff2005-03-313-8/+8
| | | | Sponsored by: Isilon Systems, Inc.
* - Remove wantparent, it is no longer necessary. An assert in vfs_lookup.cjeff2005-03-291-7/+1
| | | | | | prevents any callers from doing a modifying op without LOCKPARENT or WANTPARENT. It wasn't even properly used in the CREATE or DELETE cases.
* - Upgrade a shared lock request to exclusive in ffs_vget() if we havejeff2005-03-291-0/+9
| | | | | | to create the vnode. Sponsored by: Isilon Systems, Inc.
* - Honor the cn_lkflags passed from namei() when locking the leaf.jeff2005-03-291-2/+3
| | | | Sponsored by: Isilon Systems, Inc.
* - UFS no longer uses PDIRUNLOCK to track the parent state. Instead, we nowjeff2005-03-281-12/+7
| | | | | | | rely on ufs to always leave the parent locked except in the ISDOTDOT case. Adjust asserts to deal with these changes. Sponsored by: Isilon Systems, Inc.
* - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.jeff2005-03-281-30/+5
| | | | Sponsored by: Isilon Systems, Inc.
* When the softupdates worklist gets too long, threads that attempt todas2005-03-251-2/+5
| | | | | | | | | | | | add more work are forced to process two worklist items first. However, processing an item may generate additional work, causing the unlucky thread to recursively process the worklist. Add a per-thread flag to detect this situation and avoid the recursion. This should fix the stack overflows that could occur while removing large directory trees. Tested by: kris Reviewed by: mckusick
* - Call VFS_ROOT() with LK_EXCLUSIVE.jeff2005-03-241-1/+1
| | | | Sponsored by: Isilon Systems, Inc.
* - Update the ufs_root() prototype.jeff2005-03-241-2/+3
| | | | | | | - Pass the ufs_root() flags argument to VFS_VGET() to allow callers to specify shared locks. Sponsored by: Isilon Systems, Inc.
* - Lock the clearing of v_data in ufs_reclaim() to prevent a pagefaultjeff2005-03-171-1/+7
| | | | | | in ffs_lock() when it acesses v_data without the vnlock. Sponsored by: Isilon Systems, Inc.
* Add two arguments to the vfs_hash() KPI so that filesystems which dophk2005-03-161-2/+2
| | | | not have unique hashes (NFS) can also use it.
* Don't hold a reference on the disk vnode for each inode.phk2005-03-152-2/+2
|
* Improve the vfs_hash() API: vput() the unneeded vnode centrally tophk2005-03-151-3/+1
| | | | avoid replicating the vput in all the filesystems.
* Simplify the vfs_hash calling convention.phk2005-03-151-23/+3
|
* - Destroy the vnode object earlier in VOP_RECLAIM as we need more ofjeff2005-03-151-3/+4
| | | | | | | the vnode valid before the vm flushes pages. - Get rid of some extraneous uses of the vnode interlock. Sponsored by: Isilon Systems, Inc.
* Use vfs_hash instead of home-rolled.phk2005-03-146-191/+13
|
* - It is not legal to access v_data without the vnode lock or interlockjeff2005-03-131-1/+11
| | | | | | | held. Grab the vnode interlock if LK_INTERLOCK has not been passed in so that we can inspect v_data in ffs_lock(). Sponsored by: Isilon Systems, Inc.
* - The VI_DOOMED flag now signals the end of a vnode's relationship withjeff2005-03-131-11/+4
| | | | | | | | | the filesystem. Check that rather than VI_XLOCK. - Shorten ffs_reload by one step. The old check for an inactive vnode was slightly racey, and the code which deals with still active vnodes is not much more expensive. Sponsored by: Isilon Systems, Inc.
* - The VI_DOOMED flag now signals the end of a vnode's relationship withjeff2005-03-132-2/+2
| | | | | | the filesystem. Check that rather than VI_XLOCK. Sponsored by: Isilon Systems, Inc.
* - Fix an assert now that the XLOCK no longer exists.jeff2005-03-131-4/+1
| | | | Sponsored by: Isilon Systems, Inc.
* - In ufs_mknod(), hold the lock across the call to vgone() as that is nowjeff2005-03-131-24/+4
| | | | | | | | required. - In ufs_close(), don't do the EAGAIN vrele hack, the top layer now calls vn_start_write before the lock is acquired as it should. Sponsored by: Isilon Systems, Inc.
* - Don't drop the lock in ufs_inactive().jeff2005-03-131-4/+0
| | | | | | | | - Also in ufs_inactive, don't acquire the vnode interlock where it isn't strictly needed. Also owning the vnode interlock while calling vprint() will cause locking assertions to trip. Sponsored by: Isilon Systems, Inc.
* - Fix anoter dyslexic moment; an atomic_set_int should've become ACTIVESET,jeff2005-03-011-1/+1
| | | | | | not ACTIVECLEAR. Submitted by: iedowse
* Remove debug printout of major/minor numbers, print name instead.phk2005-02-271-2/+2
|
* use uiomove return value instead of always returning 0 when doing asam2005-02-271-2/+1
| | | | | | | readlink of a fast link Noticed by: Coverity Prevent analysis tool Reviewed by: phk
* - Add VOP locking asserts in several functions that have been implicated injeff2005-02-222-0/+5
| | | | recent deadlocks.
* The recomputation of file system summary at mount time can be adelphij2005-02-203-5/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | very slow process, especially for large file systems that is just recovered from a crash. Since the summary is already re-sync'ed every 30 second, we will not lag behind too much after a crash. With this consideration in mind, it is more reasonable to transfer the responsibility to background fsck, to reduce the delay after a crash. Add a new sysctl variable, vfs.ffs.compute_summary_at_mount, to control this behavior. When set to nonzero, we will get the "old" behavior, that the summary is computed immediately at mount time. Add five new sysctl variables to adjust ndir, nbfree, nifree, nffree and numclusters respectively. Teach fsck_ffs about these API, however, intentionally not to check the existence, since kernels without these sysctls must have recomputed the summary and hence no adjustments are necessary. This change has eliminated the usual tens of minutes of delay of mounting large dirty volumes. Reviewed by: mckusick MFC After: 1 week
* Try to unbreak the vnode locking around vop_reclaim() (based mostly onphk2005-02-192-3/+1
| | | | | | | | | patch from kan@). Pull bufobj_invalbuf() out of vinvalbuf() and make g_vfs call it on close. This is not yet a generally safe function, but for this very specific use it is safe. This solves the problem with buffers not being flushed by unmount or after failed mount attempts.
* When clearing a fragment, it's possible that the length is zero.delphij2005-02-191-1/+1
| | | | | Reviewed by: mckusick MFC After: 1 week
* - Remove the unused and unsafe ufs_ihashlookup. This function returned ajeff2005-02-142-24/+0
| | | | | | vnode pointer that could not be used since no locks were held. Sponsored by: Isilon Systems, Inc.
* Make non-SOFTUPDATES kernels compile again.phk2005-02-112-317/+269
| | | | | Integrate the stubfile into the main file now that license issues have been long resolved.
* Make a some SYSCTL_NODEs and some of FFS's VFS_ methods static.phk2005-02-104-18/+18
|
* - In the softupdates case for ffs_truncate() we use vinvalbuf() tojeff2005-02-091-0/+1
| | | | | | | | | | | invalidate pending io and dependencies. However, vinvalbuf() rightfully does not call vnode_pager_setsize() for us. We must do this here. This could potentially have caused numerous kinds of bugs, but it was specifically causing msync() deadlocks because msync() was writing flushing pages that should not have been valid. Sponsored by: Isilon Systems, Inc. Reported by: kkenn
* style polishing.phk2005-02-091-4/+3
|
OpenPOWER on IntegriCloud