wkoszek [Mon, 27 Feb 2006 16:56:22 +0000 (16:56 +0000)]
This patch fixes a problem, which exists if you have IPSEC in your kernel
and want to have crypto support loaded as KLD. By moving zlib to separate
module and adding MODULE_DEPEND directives, it is possible to use such
configuration without complication. Otherwise, since IPSEC is linked with
zlib (just like crypto.ko) you'll get following error:
interface zlib.1 already present in the KLD 'kernel'!
yar [Mon, 27 Feb 2006 12:04:13 +0000 (12:04 +0000)]
CODA_COMPAT_5 may not be defined unconditionally in the coda5 module.
Otherwise a kernel build would break in the coda5 module if the main
kernel conf file enabled CODA_COMPAT_5, too. Redefined symbols are
strictly disallowed by -Werror.
To overcome this issue, introduce a different symbol indicating coda5
build, CODA5_MODULE, and translate it to CODA_COMPAT_5 appropriately
in /sys/coda/coda.h.
mjacob [Sun, 26 Feb 2006 22:50:14 +0000 (22:50 +0000)]
Remove the ill-considered effect of using the type definitions as
distributed by LSI-Logic. For FreeBSD, just use the posix defines
instead of trying to figure out how wide an int is. Apologies to all.
imp [Sun, 26 Feb 2006 17:45:35 +0000 (17:45 +0000)]
o Bump date (thanks ru)
o Also, fdisk_pc98 appears to support -i, so add it to the man page.
o Ditto -v
o Change the name from PC partition table maintenance program to NEC PC-98x1
partition table maintenance program, since it is possible to have a DOS MBR
formatted disk on FreeBSD/pc98 now (although we don't install any tools for
this).
delphij [Sun, 26 Feb 2006 14:03:13 +0000 (14:03 +0000)]
Provide SWIDTH information so that applications like tcsh(1) can properly
handle with zh_CN.GBK locale, which is quite common for users who uses
Simplified Chinese.
davidxu [Sun, 26 Feb 2006 12:56:23 +0000 (12:56 +0000)]
1. Remove aio entry from lists earlier in aio_free_entry,
so other threads can not see it if we unlock the proc
lock (this can happen in knlist_delete). Don't do wakeup,
it is not necessary.
2. Decrease kaio_buffer_count in biohelper rather than
doing it in aio_bio_done_notify.
3. In aio_bio_done_notify, don't send notification if KAIO_RUNDOWN
was set, because the process is already in single thread mode.
4. Use assignment to initialize aiothreadflags.
5. AIOCBLIST_RUNDOWN is not useful, axe the code using it.
mjacob [Sun, 26 Feb 2006 07:46:09 +0000 (07:46 +0000)]
Shorten the time for waiting for TMF commands to complete- let's
not hang the system for 5 seconds. If a TMF doesn't complete within,
oh, say 500ms, that's enough.
Put in a printout to catch mpt_recover_commands being activated with
no commands.
mjacob [Sun, 26 Feb 2006 07:44:31 +0000 (07:44 +0000)]
a) Delay for port enable to succeed should be 30 seconds (at least) for
*both* SAS and FC, not just SAS.
b) Don't tell the chip we want it to do FIFO signalling if we actually
don't set up the address where the FIFO signal is supposed to be written
(oops).
imp [Sun, 26 Feb 2006 07:37:10 +0000 (07:37 +0000)]
Fixes and new features:
o Merge the -I switch from i386 verison to initialize the partition table
to use the maximum amount possible for a single FreeBSD table.
o Improve warning when the geom method fails (which I think it
always will until geom_pc98 is updated to respond to this ctl message)
o when writing out the boot sector, we have to write out a minimum of
1024 bytes or the sector size. This is different than the i386 case where
we need to write out a minimum of 512 bytes (which is also the minimum
sector size). We already handle this difference on reading, but didn't
in writing, so attempting to write a new partition table would fail.
o Add MID to the -s output, since pc98 users are likely interested in
both of these parameters.
# I can now initialize disks on my pc98 machine either by -I or by
# manually entering the parameters. I don't know if fdisk -B works or not,
# since I'm not willing to risk my only working boot disk to test it..
iedowse [Sun, 26 Feb 2006 02:57:57 +0000 (02:57 +0000)]
Save and restore the data toggle value when a pipe to an endpoint
is closed and then reopened. This appears to be necessary now that
we no longer clear endpoint stalls every time a pipe is opened.
Previously we could assume an initial toggle value of zero because
the clear-stall operation resets the device's toggle state.
dwmalone [Sat, 25 Feb 2006 23:50:15 +0000 (23:50 +0000)]
The quot command expected all inodes contents to be valid, however
on UFS2 inodes are initialised as they are needed, rather than at
newfs time. When quot encountered these inodes it could produce
crazy results.
Now, on UFS2 filesystems, quot's get_inode function will bzero
unallicated inodes before passing them back to a caller. This is
how UFS2 initialises new inodes, so this should work OK.
Also, while I'm here, make quot exit with an error if it finds
inodes of an unknown type. This should help catch future problems
of this type.
delphij [Sat, 25 Feb 2006 22:09:37 +0000 (22:09 +0000)]
Revert previous change for now. We traditionally add a new locale
directory when we have 10+ ports that make use of it, and now we have
only 3. This change would come back if the tt/ usage grown up to the
level.
emax [Sat, 25 Feb 2006 21:59:29 +0000 (21:59 +0000)]
Fix hard lockup caused by kbdmux(4) when kbdmux(4), PS/2 keyboard
(atkbd(4)) and PS/2 mouse (psm(4)) are used together.
Turns out that atkbd(4) check_char() method may return "true" while
read_char() method returns NOKEY. When this happens kbdmux(4) was
simply stuck in the dead loop. Avoid dead loop in kbdmux(4) by breaking
out of the loop if read_char() method returns NOKEY.
It almost seems like a bug in atkkbd(4), atkbd_check_char() calls
kbdc_data_ready(), and, the later will return "true" if there are
pending data in either kbd or aux queue. However, because both aux
and kbd are on the same controller, I'm not sure if this is a bug
or feature.
rodrigc [Sat, 25 Feb 2006 05:09:47 +0000 (05:09 +0000)]
If we specify: mount -u (update), without specifying an
additional -r (read-only) flag or or -w (read-write) flag,
then assume we want, mount -u -w.
When doing a mount update, this will implicitly pass a "noro" mount
option down to the VFS layer.
vfs_mergeopts() in vfs_mount.c will then remove the "ro" mount option
if it exists in the mount options for a mounted file system.
This means that "mount -u" works the same as "mount -u -w"
and will convert a read-only mount to read-write.
rodrigc [Sat, 25 Feb 2006 00:47:53 +0000 (00:47 +0000)]
Update text to reflect that:
- mount(8) now calls the nmount(2) system call directly, not mount(2)
- specifying a filesystem type with -t will not automatically
invoke an external /sbin/mount_XXXX program....this only happens for
certain file system types. For all other file system types, nmount(2)
is called directly.
sam [Fri, 24 Feb 2006 23:10:08 +0000 (23:10 +0000)]
fix a race whereby a tx descriptor might get reused before the hardware
is finished with it; this may only occur when the tx queue is setup as
dba-gated but since the fix is cheap apply it to all queues
while here make the queue depth signed for use in assertions
marcel [Fri, 24 Feb 2006 05:36:44 +0000 (05:36 +0000)]
When we probe a SAB82532, return BUS_PROBE_GENERIC. This allows puc(4)
or scc(4) to grab the device by default. In fact, we probably shouldn't
even claim the device at all...
marcel [Fri, 24 Feb 2006 02:24:10 +0000 (02:24 +0000)]
MFp4:
o Add defines for the 5 interrupt sources typical for serial devices.
These defines can be used for more finegrained interrupt handling
between drivers that cooperatively handle multiple serial ports.
o Add defines for the various bitmasks applicable when all information
is passed between drivers as a single integral.
marcel [Fri, 24 Feb 2006 02:06:57 +0000 (02:06 +0000)]
MFp4:
Return BUS_PROBE_LOW_PRIORITY for a successful probe. This is in
preparation of the introduction of scc(4), which is going to handle
SCCs in the near future.
jkim [Thu, 23 Feb 2006 23:41:42 +0000 (23:41 +0000)]
- Back out 1.155. I mismerged my ancient local patch. Luckily it was
completely noop.
- Geometry sanitization for non-interactive mode is moved to correct place.
Reported by: Anton Yuzhaninov <citrin at citrin dot ru>
Pointyhat: me
qingli [Thu, 23 Feb 2006 21:14:34 +0000 (21:14 +0000)]
This patch fixes the problem where the current TCP code can not handle
simultaneous open. Both the bug and the patch were verified using the
ANVL test suite.
PR: kern/74935
Submitted by: qingli (before I became committer)
Reviewed by: andre
MFC after: 5 days
wkoszek [Thu, 23 Feb 2006 20:46:10 +0000 (20:46 +0000)]
Fix the way in which median is calculated. If the data source has even
number of data points, value should be calculated by adding two middle
elements and dividing them by 2.
sos [Thu, 23 Feb 2006 20:15:22 +0000 (20:15 +0000)]
Keep the parent device (in this case the channel) around in ata_request,
so we dont panic device removal or failure.
Clean up ata_fail_requests to prevent the queue munging to fail.
jhb [Thu, 23 Feb 2006 19:13:12 +0000 (19:13 +0000)]
Use the recently added msleep_spin() function to simplify the
callout_drain() logic. We no longer need a separate non-spin mutex to
do sleep/wakeup with, instead we can now just use the one spin mutex to
manage all the callout functionality.
jhb [Thu, 23 Feb 2006 19:11:16 +0000 (19:11 +0000)]
- Use callout_init_mtx() to initialize toffhandle callout using the fdc's
mutex.
- Don't use callout_drain() to stop the toffhandle callout while holding the
fdc mutex (this could deadlock) in functions called from softclock
(callouts aren't allowed to do voluntary sleeps). Instead, use
callout_stop(). Note that since we hold the associated mutex and are now
using callout_init_mtx(), callout_stop() is just as effective as
callout_drain(). (Though callout_drain() is still needed in detach to
make sure softclock isn't contesting on our mutex before we destroy the
mutex.)
- Remove unused callout 'tohandle' from softc.
jeff [Thu, 23 Feb 2006 05:18:07 +0000 (05:18 +0000)]
- Use vfs_ref/rel to protect a mountpoint from going away while VFS_STATFS
is being called. Be sure to grab the ref before we unlock the vnode to
prevent the mount from disappearing.
jeff [Thu, 23 Feb 2006 05:15:37 +0000 (05:15 +0000)]
- Release the mount ref once the vnode has been recycled rather than once
the last reference is dropped. I forgot that vnodes can stick around
for a very long time until processes discover that they are dead. This
means that a vnode reference is not sufficient to keep the mount
referenced and even more code will be required to ref mount points.
jhb [Wed, 22 Feb 2006 18:57:50 +0000 (18:57 +0000)]
Close some races between procfs/ptrace and exit(2):
- Reorder the events in exit(2) slightly so that we trigger the S_EXIT
stop event earlier. After we have signalled that, we set P_WEXIT and
then wait for any processes with a hold on the vmspace via PHOLD to
release it. PHOLD now KASSERT()'s that P_WEXIT is clear when it is
invoked, and PRELE now does a wakeup if P_WEXIT is set and p_lock drops
to zero.
- Change proc_rwmem() to require that the processing read from has its
vmspace held via PHOLD by the caller and get rid of all the junk to
screw around with the vmspace reference count as we no longer need it.
- In ptrace() and pseudofs(), treat a process with P_WEXIT set as if it
doesn't exist.
- Only do one PHOLD in kern_ptrace() now, and do it earlier so it covers
FIX_SSTEP() (since on alpha at least this can end up calling proc_rwmem()
to clear an earlier single-step simualted via a breakpoint). We only
do one to avoid races. Also, by making the EINVAL error for unknown
requests be part of the default: case in the switch, the various
switch cases can now just break out to return which removes a _lot_ of
duplicated PRELE and proc unlocks, etc. Also, it fixes at least one bug
where a LWP ptrace command could return EINVAL with the proc lock still
held.
- Changed the locking for ptrace_single_step(), ptrace_set_pc(), and
ptrace_clear_single_step() to always be called with the proc lock
held (it was a mixed bag previously). Alpha and arm have to drop
the lock while the mess around with breakpoints, but other archs
avoid extra lock release/acquires in ptrace(). I did have to fix a
couple of other consumers in kern_kse and a few other places to
hold the proc lock and PHOLD.
Tested by: ps (1 mostly, but some bits of 2-4 as well)
MFC after: 1 week
jhb [Wed, 22 Feb 2006 18:16:26 +0000 (18:16 +0000)]
- Use bus_setup_intr() and bus_teardown_intr() to register device driver
interrupt handlers rather than BUS_SETUP_INTR() and BUS_TEARDOWN_INTR().
Uses of the BUS_*() versions in the implementation of foo_intr methods
in bus drivers were not changed. Mostly this just means that some
drivers might start printing diagnostic messages like [FAST] when
appropriate as well as honoring mpsafenet=0.
- Fix two more of the ppbus drivers' identify routines to function
correctly in the mythical case of a machine with more than one ppbus.
jhb [Wed, 22 Feb 2006 17:24:54 +0000 (17:24 +0000)]
Change pfs_visible() to optionally return a pointer to the process
associated with the passed in pfs_node. If it does return a pointer, it
keeps the process locked. This allows a lot of places that were calling
pfind() again right after pfs_visible() to not have to do that and avoids
races since we don't drop the proc lock just to turn around and lock it
again. This will become more important with future changes to fix races
between procfs/ptrace and exit(2). Also, removed a duplicate pfs_visible()
call in pfs_getextattr().
jhb [Wed, 22 Feb 2006 17:21:45 +0000 (17:21 +0000)]
Don't do a PHOLD() in kthread_create() w/o a matching PRELE() in
kthread_exit(). Rather than add the missing PRELE() I chose to just
axe the PHOLD() since it was redundant with the P_SYSTEM flag.
jhb [Wed, 22 Feb 2006 17:20:37 +0000 (17:20 +0000)]
Hold the proc lock while calling proc_sstep() since the function asserts
it and remove a PRELE() that didn't have a matching PHOLD(). The calling
code already has a PHOLD anyway.