Age | Commit message (Collapse) | Author |
|
|
|
will make pedro happy too (;
|
|
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
|
|
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
|
|
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.
|
|
|
|
No functional change, okay tedu@.
|
|
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.
|
|
|
|
Issued noted and fix okay'd by otto@.
|
|
- 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
|
|
softdep_disk_io_initiation(). Testing by dtucker@ and krw@, okay
deraadt@ long ago.
|
|
|
|
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@
|
|
been worked on, so EA is pointless. Also the code is not enabled
in GENERIC so it is not being tested or maintained.
|
|
|
|
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.
|
|
|
|
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@.
|
|
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@.
|
|
revert.
|
|
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@
|
|
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@
|
|
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
|
|
|
|
|
|
|
|
way for some future work. no function changes yet.
few other little cleanups.
help testing otto@ and markus@
|
|
|
|
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@
|
|
|
|
Diff generated by Chris Kuethe.
|
|
Fix two problems with softdep_typenames (missing entry, wrong boundary check);
wiz@netbsd.org
art@ OK
|
|
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).
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
|
|
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.
|
|
In flush_inodedep_deps - release the lock before sleep.
When allocating a pagecache dependency buffer - make sure it's always
correctly initialized.
|
|
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.
|
|
|
|
(Look ma, I might have broken the tree)
|