Age | Commit message (Collapse) | Author |
|
The inheritace is implemented by setting the default vnodeop to a
bypass op that repeats the operation on the spec/fifo vnodeop vector.
The overhead of one extra indirect function call is worth the cleanup
and improved correctness.
This actually solves a few bugs where some vnode ops were missing from
some vectors (like kqfilter or revoke). (and even more on the ubc
branch).
Inspired by the same thing done in FreeBSD.
|
|
Diff generated by Chris Kuethe.
|
|
files up to 16TB, we do limit the max file to 2^31 pages to prevent
overflow of a 32-bit unsigned int. The buffer cache has its own
checks but a little added paranoia never hurts. Adapted from a patch
in FreeBSD.
|
|
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.
|
|
|
|
Synch files that use that field.
(This argument is an internal interface specific to OpenBSD, so it won't
cause compatibility problems.)
(No bump, not an ABI change).
ok art, millert...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
well (not at all) with shortages of the vm_map where the pages are mapped
(usually kmem_map).
Try to deal with it:
- group all information the backend allocator for a pool in a separate
struct. The pool will only have a pointer to that struct.
- change the pool_init API to reflect that.
- link all pools allocating from the same allocator on a linked list.
- Since an allocator is responsible to wait for physical memory it will
only fail (waitok) when it runs out of its backing vm_map, carefully
drain pools using the same allocator so that va space is freed.
(see comments in code for caveats and details).
- change pool_reclaim to return if it actually succeeded to free some
memory, use that information to make draining easier and more efficient.
- get rid of PR_URGENT, noone uses it.
|
|
From FreeBSD
|
|
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.
|
|
- get rid of VOP_BALLOCN and VOP_SIZE
- move the generic getpages and putpages into miscfs/genfs
- create a genfs_node which must be added to the top of the private portion
of each vnode for filsystems that want to use genfs_{get,put}pages
- rename genfs_mmap to vop_generic_mmap
|
|
|
|
|
|
the filesystem if we're allowed to mmap the file.
|
|
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.
|
|
|
|
and bpp == NULL.
|
|
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.
|
|
|
|
Pass over the quota code in ufs/. Make code paths clearer. Clean up some names.
Move all code that manipulates quotas directly into ufs_quota.c
Use vfs_mount_foreach_vnode to traverse list of vnodes in mountpoint.
|
|
|
|
|
|
|
|
buffer in that case. Also add a new argument - blknop, which can be used to
return the allocated blkno.
|
|
(Look ma, I might have broken the tree)
|
|
|
|
when doing sync. From FreeBSD.
art@ ok.
|
|
fix the rest of the kernel some other time.
|
|
regular files.
ftruncate and truncate that go through FFS/EXT2FS/MFS will now return
EINVAL when done on devices.
Bug introduced when VOP_TRUNCATE was removed, thus removing spec_truncate.
Thanks to millert@ for tracking this one down.
|
|
|
|
|
|
|
|
|
|
fixes "duplicated free" panic. Update file system from read-write to
read-only freed memory but may fail later if file system busy.
deraadt@ ok.
|
|
From FreeBSD with little changes.
art@ ok.
|
|
This problem occur only on kernels without soft-updates support.
art@ ok.
|
|
FreeBSD's log:
> The ffs superblock includes a 128-byte region for use by temporary
> in-core pointers to summary information. An array in this region
> (fs_csp) could overflow on filesystems with a very large number of
> cylinder groups (~16000 on i386 with 8k blocks). When this happens,
> other fields in the superblock get corrupted, and fsck refuses to
> check the filesystem.
>
> Solve this problem by replacing the fs_csp array in 'struct fs'
> with a single pointer, and add padding to keep the length of the
> 128-byte region fixed. Update the kernel and userland utilities
> to use just this single pointer.
>
> With this change, the kernel no longer makes use of the superblock
> fields 'fs_csshift' and 'fs_csmask'. Add a comment to newfs/mkfs.c
> to indicate that these fields must be calculated for compatibility
> with older kernels.
art@ ok.
|
|
|
|
since fs_contigdirs takes 64 bits on those platforms. This fixes
a problem on alpha where "struct fs" grew. A better solution is
to make fs_csp into a pointer and use the remainder for pointer
spares and allocate fs_contigdirs from those. This will happen
some time post-2.9.
|
|
It allocates directory inode in the same cylinder group as a parent
directory in. This speedup file/directory intensive operations on
a big file systems in times.
Don't forget to recompile fsck_ffs with updated fs.h or you will get
"VALUES IN SUPER BLOCK DISAGREE WITH THOSE IN FIRST ALTERNATE" at
the next boot. In any case you can ignore this error safely.
Requested by deraadt@
|