phk [Sun, 28 Oct 2001 09:39:28 +0000 (09:39 +0000)]
Fix a problem in the disk related hack where device nodes for a physically
non-existent disk in a legacy /dev on a DEVFS system would panic the system
if stat(2)'ed.
Do not whine about anonymous device nodes not having a si_devsw, they're
not supposed to.
dillon [Sun, 28 Oct 2001 02:45:04 +0000 (02:45 +0000)]
Various string fields for certain cpio types are 11 rather then 8
characters. Use quad conversion functions rather then long conversion
where appropriate to handle the available range. Mainly fixes time_t
but there was also a st_size ulong conversion in there that has to be
quad or cpio cannot be used to copy files > 2G.
mike [Sat, 27 Oct 2001 20:11:10 +0000 (20:11 +0000)]
Only provide function information in compile environments that support
the C99 variable __func__ and never for C++. Provide a more meaningful
example in the assert(3) manual.
des [Sat, 27 Oct 2001 11:15:19 +0000 (11:15 +0000)]
Eliminate the prefix parameter to linux_emul_find(), which was always
linux_emul_path anyway. Linux_emul_find() has interesting bugs in its
prefix handling (which luckily are not currently exploitable); this
commit is preliminary to an attempt at cleaning it up.
des [Sat, 27 Oct 2001 11:11:25 +0000 (11:11 +0000)]
Add a P_INEXEC flag that indicates that the process has called execve() and
it has not yet returned. Use this flag to deny debugging requests while
the process is execve()ing, and close once and for all any race conditions
that might occur between execve() and various debugging interfaces.
rwatson [Sat, 27 Oct 2001 05:45:42 +0000 (05:45 +0000)]
o Improve style(9) compliance following KSE modifications. In particular,
strip the space from '( struct thread *...', wrap long lines.
o Remove an unneeded comment on the topic of no lock being required as
part of the NDINIT() in __acl_get_file(), as it's really not required
there.
rwatson [Sat, 27 Oct 2001 05:39:17 +0000 (05:39 +0000)]
o Althought this is not specified in POSIX.1e, the UFS ACL implementation
coerces the deletion of a default ACL on a directory when no default
ACL EA is present to success. Because the UFS EA implementation doesn't
disinguish the EA failure modes "that EA name has not been
administratively enabled" from "that EA name has no defined data",
there's a potential conflict in error return values. Normally, the
lack of administratively configured EA support is coerced to
EOPNOTSUPP to indicate that ACLs are not available; in this case,
it is possible to get a successful return, even if ACLs are not
available because EA support for them has not been enabled.
Expand the comment in ufs_setacl() to identify this case.
rwatson [Sat, 27 Oct 2001 05:19:14 +0000 (05:19 +0000)]
o Clarify a comment about the locking condition of the vnode upon exit
from ufs_extattr_enable_with_open().
o Print auto-start notifications if (bootverbose). This was previously
commented out since it didn't know how to check for bootverbose.
o Drop in comments throughout indicating where ENOENT should be replaced
with ENOATTR once that is available.
rwatson [Sat, 27 Oct 2001 05:05:39 +0000 (05:05 +0000)]
o The comment about ordering the destruction of the lock and the removal of
the flag indicating that the structure was initialized didn't need
an XXX, since it didn't need fixing.
rwatson [Sat, 27 Oct 2001 04:58:28 +0000 (04:58 +0000)]
Since namespace support was added to the UFS extended attribute
implementation to replace single-character namespace prefixes, '$' is no
longer an invalid attribute name, and the namespace is relevant to
validity determination.
o Remove '$' case from ufs_extattr_valid_attrname()
o Add attrnamespace argument to ufs_extattr_valid_attrname(), and
fill out appropriately.
Currently no decisions are made based on the namespace argument, but
may be in the future.
peter [Sat, 27 Oct 2001 02:13:41 +0000 (02:13 +0000)]
Explicitly use int32_t for on-disk records for pw_change and pw_expire,
since that is what we use now and this insulates us from any time_t
tweaks here. We can define a record format that uses 64 bit times if/when
we need to.
luigi [Sat, 27 Oct 2001 00:59:17 +0000 (00:59 +0000)]
Enable round-robin arbitration between transmit and receive unit
in the 21143, instead of giving priority to the receive unit.
This gives a 10-15% performance improvement in the forwarding rate
under heavy load.
des [Sat, 27 Oct 2001 00:52:50 +0000 (00:52 +0000)]
Support the "install.debug" and "reinstall.debug" targets for kernel modules.
Small tweaks to kldxref may be necessary to avoid the surprising (but harm-
less) behaviour of 'kldload foo' loading foo.ko.debug instead of foo.ko if
it is present in the kernel directory.
Approved by: a week of silence on -arch
MFC after: 2 weeks
fenner [Fri, 26 Oct 2001 23:10:08 +0000 (23:10 +0000)]
Force the length of the sockaddr to be correct for AF_INET and AF_INET6
in bind() and connect(). Linux doesn't care if the length of the
sockaddr matches its address family; FreeBSD does. This fixes the
known issues with the resolver in linux_base-7.
peter [Fri, 26 Oct 2001 21:19:22 +0000 (21:19 +0000)]
Make libc_r check the kern.usrstack sysctl instead of using internal
kernel #defines to figure out where the stack is located. This stops
libc_r from exploding when the kernel is compiled with a different
KVM size. IMHO this is all kinda bogus, it would be better to just
check %esp and work from that.
dillon [Fri, 26 Oct 2001 20:48:04 +0000 (20:48 +0000)]
Add mtx_lock_giant() and mtx_unlock_giant() wrappers for sysctl management
of Giant during the Giant unwinding phase, and start work on instrumenting
Giant for the file and proc mutexes.
These wrappers allow developers to turn on and off Giant around various
subsystems. DEVELOPERS SHOULD NEVER TURN OFF GIANT AROUND A SUBSYSTEM JUST
BECAUSE THE SYSCTL EXISTS! General developers should only considering
turning on Giant for a subsystem whos default is off (to help track down
bugs). Only developers working on particular subsystems who know what
they are doing should consider turning off Giant.
These wrappers will greatly improve our ability to unwind Giant and test
the kernel on a (mostly) subsystem by subsystem basis. They allow Giant
unwinding developers (GUDs) to emplace appropriate subsystem and structural
mutexes in the main tree and then request that the larger community test
the work by turning off Giant around the subsystem(s), without the larger
community having to mess around with patches. These wrappers also allow
GUDs to boot into a (more likely to be) working system in the midst of
their unwinding work and to test that work under more controlled
circumstances.
There is a master sysctl, kern.giant.all, which defaults to 0 (off). If
turned on it overrides *ALL* other kern.giant sysctls and forces Giant to
be turned on for all wrapped subsystems. If turned off then Giant around
individual subsystems are controlled by various other kern.giant.XXX sysctls.
Code which overlaps multiple subsystems must have all related subsystem Giant
sysctls turned off in order to run without Giant.
bmah [Fri, 26 Oct 2001 20:26:59 +0000 (20:26 +0000)]
If an article in the release documentation has a table of contents,
make it go down to 3 section levels (the default depth for FreeBSD
articles is 1 level, but few articles have tables-of-contents
enabled).
jhb [Fri, 26 Oct 2001 18:46:48 +0000 (18:46 +0000)]
- Change the taskqueue locking to protect the necessary parts of a task
while it is on a queue with the queue lock and remove the per-task locks.
- Remove TASK_DESTROY now that it is no longer needed.
- Go back to inlining TASK_INIT now that it is short again.
iwasaki [Fri, 26 Oct 2001 17:43:05 +0000 (17:43 +0000)]
Add APM compatibility feature to ACPI.
This emulates APM device node interface APIs (mainly ioctl) and
provides APM services for the applications. The goal is to support
most of APM applications without any changes.
Implemented ioctls in this commit are:
- APMIO_SUSPEND (mapped ACPI S3 as default but changable by sysctl)
- APMIO_STANDBY (mapped ACPI S1 as default but changable by sysctl)
- APMIO_GETINFO and APMIO_GETINFO_OLD
- APMIO_GETPWSTATUS
With above, many APM applications which get batteries, ac-line
info. and transition the system into suspend/standby mode (such as
wmapm, xbatt) should work with ACPI enabled kernel (if ACPI works well :-)
ru [Fri, 26 Oct 2001 17:22:12 +0000 (17:22 +0000)]
From ChangeLog:
: 2001-10-19 Ruslan Ermilov <ru@FreeBSD.org>
:
: * tmac/doc.tmac (doc-flag-recursion): Protect arguments against
: being handled as end-of-sentence characters,
This fixes ".Fl \&?". Previously, it produced an additional whitespace.
There were no precedents in FreeBSD manpages. That's why it was
mjacob [Fri, 26 Oct 2001 16:13:47 +0000 (16:13 +0000)]
Detach the prom console when platform.cons_init is called. This seems
to avoid most of the double character kernel goop we've been having by having
both a prom console && a normal console.
Was not able to test with graphics head. Hope this doesn't break anything.
jhb [Fri, 26 Oct 2001 08:12:54 +0000 (08:12 +0000)]
Add a per-thread ucred reference for syscalls and synchronous traps from
userland. The per thread ucred reference is immutable and thus needs no
locks to be read. However, until all the proc locking associated with
writes to p_ucred are completed, it is still not safe to use the per-thread
reference.
jhb [Fri, 26 Oct 2001 06:32:21 +0000 (06:32 +0000)]
Add locking to taskqueues. There is one mutex per task, one mutex per
queue, and a mutex to protect the global list of taskqueues. The only
visible change is that a TASK_DESTROY() macro has been added to mirror
the TASK_INIT() macro to destroy a task before it is free'd.
jhb [Fri, 26 Oct 2001 06:09:01 +0000 (06:09 +0000)]
Use msleep() to avoid lost wakeup's instead of doing an ineffective
splhigh() before the mtx_unlock and tsleep(). The splhigh() was probably
correct in the original code using simplelocks but is not correct in
5.0-current.
dillon [Fri, 26 Oct 2001 00:08:05 +0000 (00:08 +0000)]
Implement kern.maxvnodes. adjusting kern.maxvnodes now actually has a
real effect.
Optimize vfs_msync(). Avoid having to continually drop and re-obtain
mutexes when scanning the vnode list. Improves looping case by 500%.
Optimize ffs_sync(). Avoid having to continually drop and re-obtain
mutexes when scanning the vnode list. This makes a couple of assumptions,
which I believe are ok, in regards to vnode stability when the mount list
mutex is held. Improves looping case by 500%.
(more optimization work is needed on top of these fixes)
iedowse [Thu, 25 Oct 2001 22:55:59 +0000 (22:55 +0000)]
Default to not performing ufs_dirhash's extensive directory-block
sanity check after every directory modification. This check can be
re-enabled at any time by setting the sysctl "vfs.ufs.dirhash_docheck"
to 1.
This group of sanity tests was there to ensure that any UFS_DIRHASH
bugs could be caught by a panic before a potentially corrupted
directory block would be written to disk. It has served its main
purpose now, so disable it in the interest of performance.
dillon [Thu, 25 Oct 2001 22:49:48 +0000 (22:49 +0000)]
In cluster_rbuild(), 'size' had better match buf->b_bcount and buf->b_bufsize
or the cluster will not be properly merged. Dup the code from
cluster_wbuild() and add some printf()s to see if bad cases are present.
rwatson [Thu, 25 Oct 2001 20:45:47 +0000 (20:45 +0000)]
o Modify format of /etc/fbtab to accept glob matching patterns for
target devices, not just individual devices and directories. This
permits activities such as:
ttyv0 0600 /dev/dsp*
Whereas previously that was not supported. This change is
backwards-compatible, except where device names included globbing
characters, which is not the case for any devices listed in MAKEDEV.
Submitted by: Maxime Henrion <mux@qualys.com>
MFC after: 3 weeks
iedowse [Thu, 25 Oct 2001 19:07:56 +0000 (19:07 +0000)]
Now that nfsm_reply() does not usually set 'error' to 0, we need
to do it explicitly in nfsrv_noop so that the reply gets sent back
to the client. This fixes the generation of a selection of RPC
error replies (RPC_PROGMISMATCH, RPC_PROGUNAVAIL, RPC_PROCUNAVAIL
etc.) that are used by some clients to detect support for optional
protocols and features.
Reviewed by: peter
Reported by: Thomas Quinot <quinot@inf.enst.fr>
PR: kern/31479