summaryrefslogtreecommitdiff
path: root/sys/ufs/ffs/ffs_softdep.c
AgeCommit message (Collapse)Author
2006-07-27missing \n in ddb printfMichael Shalayeff
2006-07-11add mount/vnode/buf and softdep printing commands; tested on a few archs and ↵Michael Shalayeff
will make pedro happy too (;
2006-06-28from freebsd 1.179:Michael Shalayeff
When the softupdates worklist gets too long, threads that attempt to 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. pedro@ tedu@ ok
2006-06-21propagate the wait flag from fsync down to softdep_fsync_mountdev()Michael Shalayeff
and do not perform synchronous sync there is no wait requested by skipping the drain_output() call. this fixes a problem where update kthread would sleep forever on some vnode since work is created faster than it can be flushed. pedro@ ok; tested by many
2006-06-07from freebsd r1.185 (tested by beck@ and krw@; pedro@ ok):Michael Shalayeff
After a rmdir()ed directory has been truncated, force an update of the directory's inode after queuing the dirrem that will decrement the parent directory's link count. This will force the update of the parent directory's actual link to actually be scheduled. Without this change the parent directory's actual link count would not be updated until ufs_inactive() cleared the inode of the newly removed directory, which might be deferred indefinitely. ufs_inactive() will not be called as long as any process holds a reference to the removed directory, and ufs_inactive() will not clear the inode if the link count is non-zero, which could be the result of an earlier system crash. If a background fsck is run before the update of the parent directory's actual link count has been performed, or at least scheduled by putting the dirrem on the leaf directory's inodedep id_bufwait list, fsck will corrupt the file system by decrementing the parent directory's effective link count, which was previously correct because it already took the removal of the leaf directory into account, and setting the actual link count to the same value as the effective link count after the dangling, removed, leaf directory has been removed. This happens because fsck acts based on the actual link count, which will be too high when fsck creates the file system snapshot that it references. This change has the fortunate side effect of more quickly cleaning up the large number dirrem structures that linger for an extended time after the removal of a large directory tree. It also fixes a potential problem with the shutdown of the syncer thread timing out if the system is rebooted immediately after removing a large directory tree.
2006-01-03Add UFS2 softdep bits, okay tedu@Pedro Martelletto
2005-12-28Use the DIP macros to uniformly access fields from UFS1 and UFS2 dinodes.Pedro Martelletto
No functional change, okay tedu@.
2005-12-17Remove the 'on disk' inode (dinode) from the 'in memory' inode in UFS.Pedro Martelletto
Instead of having the dinode inside the inode structure itself, we now have just a pointer to it, and use a separate pool to allocate dinodes as needed. Inspiration from FreeBSD, various testing for a while, thanks.
2005-12-14typoPedro Martelletto
2005-10-25Correctly remove elements from a pagedep dirrem list.Pedro Martelletto
Issued noted and fix okay'd by otto@.
2005-09-26bring in two changes from freebsd:Pedro Martelletto
- keep track of free blocks dependencies, and only tell the syncer to release the blocks when there are no more dirty buffers associated - don't mark the inode dependency as done if we had to rollback its allocation due to the bitmap being inconsistent testing by krw, jsg, jmc and sturm, okay deraadt
2005-09-06Enforce splbio() while traversing the worklist inPedro Martelletto
softdep_disk_io_initiation(). Testing by dtucker@ and krw@, okay deraadt@ long ago.
2005-08-08Add a few splassert() checks, okay art@Pedro Martelletto
2005-07-20Reintroduce the changes made by tedu in revision 1.50 of ffs_softdep.c,Pedro Martelletto
this time with a small tweak: when flushing the dependencies, don't update the inode twice, but update once, and then, if needed, fsync it. Doing so fixes the inode hangs some people were seeing. Various testing for a while, especially krw@ and millert@, okay deraadt@
2005-07-03Extended Attributes was a piece to get to ACLs, however ACLs have notDale Rahn
been worked on, so EA is pointless. Also the code is not enabled in GENERIC so it is not being tested or maintained.
2005-06-18Remove remaining whiteout tentacles; OK deraadt@ miod@ weingart@Todd C. Miller
2005-06-10Tweak softdep_change_linkcnt() so we can specify whether we're willingPedro Martelletto
to be co-opted by softdep or not, and use this new interface to inform softdep in ufs_inactive() that the inode mode has changed. We don't want to be co-opted there as that might lead to undesired circular dependencies such as a vput() depending on another vput() to complete, or a process that is trying to free up a vnode being blocked trying to acquire a new vnode. Okay tedu@ deraadt@, thanks to all those who tested.
2005-05-24brelse() on failed bread()Pedro Martelletto
2004-12-09When removing the last item from a non-empty worklist, the worklistTodd C. Miller
tail pointer must be updated; from FreeBSD (mckusick). Appears to fix problems I was seeing with processes stuck with WCHAN=inode in rev 1.50. OK pedro@ and tedu@.
2004-12-08Move a FREE_LOCK until after a potential continue so we don't tryTodd C. Miller
to free the lock twice. Doesn't actually make any difference for us (no .o file diff) since the code block that contains the continue is currently commented out but it makes sense to fix this now so if/when that code is enabled we don't get bitten. From FreeBSD, ok pedro@.
2004-12-07prev softdep merge could lead to inode wait deadlock for unknown reasons.Ted Unangst
revert.
2004-07-13Change mode_t and nlink_t from 16bit to 32bit. This allows us toTodd C. Miller
use mode_t in syscalls.master and to use mode_t in more places in the kernel. It also makes lint much more useful on kernel code. I've also added a placeholder for st_birthtime to make a UFS2 import easier at some future date. Requested by and OK deraadt@
2004-06-24This moves access to wall and uptime variables in MI code,Thorsten Lockert
encapsulating all such access into wall-defined functions that makes sure locking is done as needed. It also cleans up some uses of wall time vs. uptime some places, but there is sure to be more of these needed as well, particularily in MD code. Also, many current calls to microtime() should probably be changed to getmicrotime(), or to the {,get}microuptime() versions. ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others "Oh, that is not your problem!" from miod@
2004-05-07fatty softdep merge with freebsd. fixes a variety of possible issues.Ted Unangst
relevant changes to ffs_softdep.c were 1.95, 1.96, 1.97, 1.98, 1.103, and 1.107 in freebsd. testing marc and otto. ok deraadt
2004-01-20some pieces of ufs2. help testing otto sturmTed Unangst
2003-11-19undo boolshit unapproved changes the author does not even care about to fixMichael Shalayeff
2003-11-19MALLOC is not meant for variable size allocationsTed Unangst
2003-08-25rename struct dinode to ufs1_dinode. clears the namespace and makesTed Unangst
way for some future work. no function changes yet. few other little cleanups. help testing otto@ and markus@
2003-08-02newline at end of printfTed Unangst
2003-05-26fiddle with some type names. change most instances of ufs_daddr_t toTed Unangst
ufs1_daddr_t, a few to daddr_t. ufs_daddr_t typedef is retained, but consider it deprecated. no functional changes. inspired by freebsd. ok art@
2003-05-14remove the last of the MI commonsJason Wright
2002-10-12Remove more '\n's from panic() statements. Both trailing and leading.Kenneth R Westerback
Diff generated by Chris Kuethe.
2002-07-16Fix typo which prevents diagnostic test from working; enami@netbsd.orgTodd C. Miller
Fix two problems with softdep_typenames (missing entry, wrong boundary check); wiz@netbsd.org art@ OK
2002-07-12Change the locking on the mountpoint slightly. Instead of using mnt_lockArtur Grabowski
to get shared locks for lookup and get the exclusive lock only with LK_DRAIN on unmount and do the real exclusive locking with flags in mnt_flags, we now use shared locks for lookup and an exclusive lock for unmount. This is accomplished by slightly changing the semantics of vfs_busy. Old vfs_busy behavior: - with LK_NOWAIT set in flags, a shared lock was obtained if the mountpoint wasn't being unmounted, otherwise we just returned an error. - with no flags, a shared lock was obtained if the mountpoint was being unmounted, otherwise we slept until the unmount was done and returned an error. LK_NOWAIT was used for sync(2) and some statistics code where it isn't really critical that we get the correct results. 0 was used in fchdir and lookup where it's critical that we get the right directory vnode for the filesystem root. After this change vfs_busy keeps the same behavior for no flags and LK_NOWAIT. But if some other flags are passed into it, they are passed directly into lockmgr (actually LK_SLEEPFAIL is always added to those flags because if we sleep for the lock, that means someone was holding the exclusive lock and the exclusive lock is only held when the filesystem is being unmounted. More changes: dounmount must now be called with the exclusive lock held. (before this the caller was supposed to hold the vfs_busy lock, but that wasn't always true). Zap some (now) unused mount flags. And the highlight of this change: Add some vfs_busy calls to match some vfs_unbusy calls, especially in sys_mount. (lockmgr doesn't detect the case where we release a lock noone holds (it will do that soon)). If you've seen hangs on reboot with mfs this should solve it (I repeat this for the fourth time now, but this time I spent two months fixing and redesigning this and reading the code so this time I must have gotten this right).
2002-06-08Remove this horror DIAGNOSTIC define. It was just ugly when itArtur Grabowski
was introduced, but now it causes crashes when kernels are built without DIAGNOSTIC. Instead of trying to debug this incorrect code, I'm just removing this abomination.
2002-06-08Let this build when the internal DIAGNOSTIC define is removed.Artur Grabowski
2002-03-14First round of __P removal in sysTodd C. Miller
2002-02-22Extended Attribute support from FreeBSD/TrustedBSD ok art@, deraadt@Dale Rahn
2002-01-29process the delayed-free queue more often; chs@netbsd.orgTodd C. Miller
2002-01-25Move softdep sysctls from debug to vfs.ffs; art@ OKTodd C. Miller
2002-01-24sigh, nobody compiles before commit anymoreMichael Shalayeff
2002-01-23Convert to pool; based on changes NetBSDTodd C. Miller
We no longer use the last arg to WORKITEM_FREE but I have not removed it from the calls in order to simplify these diffs and further softdep merges.
2001-12-19UBC was a disaster. It worked very good when it worked, but on someArtur Grabowski
machines or some configurations or in some phase of the moon (we actually don't know when or why) files disappeared. Since we've not been able to track down the problem in two weeks intense debugging and we need -current to be stable, back out everything to a state it had before UBC. We apologise for the inconvenience.
2001-12-10Merge in struct uvm_vnode into struct vnode.Artur Grabowski
2001-12-05Make DEBUG not default, and make the default compileNiklas Hallqvist
2001-12-04FREE_LOCK_INTERLOCKED drops the lock owner without changing lock "state".Artur Grabowski
ACQUIRE_LOCK_INTERLOCKED set the owner back without validating that the state is ok. This could lead to changed states and FREE_LOCK could set spl to any random value. Try to preserve the state of the lock. XXX - all this locking in the code is insane. all this debugging code breaks stuff.
2001-11-28Bug fixes from NetBSD.Artur Grabowski
In flush_inodedep_deps - release the lock before sleep. When allocating a pagecache dependency buffer - make sure it's always correctly initialized.
2001-11-27Merge in the unified buffer cache code as found in NetBSD 2001/03/10. TheArtur Grabowski
code is written mostly by Chuck Silvers <chuq@chuq.com>/<chs@netbsd.org>. Tested for the past few weeks by many developers, should be in a pretty stable state, but will require optimizations and additional cleanups.
2001-11-13Add two controlled panics instead of some code that I need to write later.Artur Grabowski
2001-11-06Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.Miod Vallat
(Look ma, I might have broken the tree)