summaryrefslogtreecommitdiffstats
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* This patch fixes the problem where the current TCP code can not handleqingli2006-02-233-3/+4
| | | | | | | | | | 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
* Keep the parent device (in this case the channel) around in ata_request,sos2006-02-232-17/+27
| | | | | so we dont panic device removal or failure. Clean up ata_fail_requests to prevent the queue munging to fail.
* Remove some dead code.jhb2006-02-231-3/+1
| | | | | | | Coverity ID: 822 Found by: Coverity Prevent Reviewed by: ariff MFC after: 1 week
* Use the recently added msleep_spin() function to simplify thejhb2006-02-231-56/+41
| | | | | | 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.
* - Use callout_init_mtx() to initialize toffhandle callout using the fdc'sjhb2006-02-231-9/+5
| | | | | | | | | | | | | | | 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. MFC after: 1 week
* In ata_cmd_allocate() only call ata_pci_allocate once.sos2006-02-231-1/+0
| | | | found by: jhb@
* Check the return value of copyin() and return an error if it fails.jhb2006-02-231-2/+4
| | | | | | | Coverity ID: 839 Found by: Coverity Prevent MFC after: 1 week Reviewed by: ps, scottl
* Unhook myri10ge from build in preparation for renamegallatin2006-02-231-3/+0
|
* 1. Refine kern_sigtimedwait() to remove redundant code.davidxu2006-02-231-31/+43
| | | | | | | 2. Fix a bug, if thread got a SIGKILL signal, call sigexit() to kill its process. MFC after: 3 days
* Code cleanup, simply compare with curproc.davidxu2006-02-231-2/+1
|
* - Use vfs_ref/rel to protect a mountpoint from going away while VFS_STATFSjeff2006-02-232-20/+58
| | | | | | | is being called. Be sure to grab the ref before we unlock the vnode to prevent the mount from disappearing. Tested by: kris
* - Release the mount ref once the vnode has been recycled rather than oncejeff2006-02-231-3/+2
| | | | | | | | | 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. Discovered by: kris
* Move comments to more accurate place.davidxu2006-02-231-4/+4
|
* Fix a sleep queue race for KSE thread.davidxu2006-02-233-53/+25
| | | | Reviewed by: jhb
* G/C unused variable.jhb2006-02-221-1/+0
|
* guard function decls with _KERNEL so user code can include this filesam2006-02-221-1/+2
| | | | MFC after: 1 week
* Fixup some comments. Mutexes's are locked, not entered for several yearsjhb2006-02-221-5/+5
| | | | now and msleep blocks threads rather than processes.
* Close some races between procfs/ptrace and exit(2):jhb2006-02-2211-115/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* - Use bus_setup_intr() and bus_teardown_intr() to register device driverjhb2006-02-2216-36/+29
| | | | | | | | | | 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.
* Change pfs_visible() to optionally return a pointer to the processjhb2006-02-221-50/+44
| | | | | | | | | | | | | 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(). Reviewed by: des MFC after: 1 week
* Don't do a PHOLD() in kthread_create() w/o a matching PRELE() injhb2006-02-221-1/+0
| | | | | | | kthread_exit(). Rather than add the missing PRELE() I chose to just axe the PHOLD() since it was redundant with the P_SYSTEM flag. MFC after: 1 week
* Hold the proc lock while calling proc_sstep() since the function assertsjhb2006-02-221-2/+1
| | | | | | | it and remove a PRELE() that didn't have a matching PHOLD(). The calling code already has a PHOLD anyway. MFC after: 1 week
* Use bus_setup_intr() rather than invoking BUS_SETUP_INTR() directly so thatjhb2006-02-221-4/+2
| | | | puc still prints out [FAST] on Peter's box.
* Various style and comment fixes.jhb2006-02-221-8/+7
| | | | Submitted by: bde
* Add pathname and/or vnode argument auditing for the following system calls:wsalamon2006-02-222-100/+258
| | | | | | | | | | | | | | | | | | quotactl, statfs, fstatfs, fchdir, chdir, chroot, open, mknod, mkfifo, link, symlink, undelete, unlink, access, eaccess, stat, lstat, pathconf, readlink, chflags, lchflags, fchflags, chmod, lchmod, fchmod, chown, lchown, fchown, utimes, lutimes, futimes, truncate, ftruncate, fsync, rename, mkdir, rmdir, getdirentries, revoke, lgetfh, getfh, extattrctl, extattr_set_file, extattr_set_link, extattr_get_file, extattr_get_link, extattr_delete_file, extattr_delete_link, extattr_list_file, extattr_list_link. In many cases the pathname and vnode auditing is done within namei lookup instead of directly in the system call. Audit the remaining arguments to these system calls: fstatfs, fchdir, open, mknod, chflags, lchflags, fchflags, chmod, lchmod, fchmod, chown, lchown, fchown, futimes, ftruncate, fsync, mkdir, getdirentries.
* Back out 1.112,1.113. I don't have enough resources to fix breakagesglebius2006-02-221-1/+7
| | | | introduced by this change.
* Do not use bio structure after g_io_deliver(), it may not longer by valid.pjd2006-02-221-1/+1
| | | | | Found and fixed by: Vsevolod Lobko <seva@ip.net.ua> MFC after: 3 days
* - Revert r1.406 until a solution can be found that doesn't break nfs. Thejeff2006-02-222-56/+42
| | | | | | | | statfs handler in nfs will lock vnodes which may lead to deadlock or recursion. Found by: kris Pointy hat to: me
* - We must hold a reference to a vnode before calling vgone() otherwisejeff2006-02-221-0/+2
| | | | | | | it may not be removed from the freelist. MFC After: 1 week Found by: kris
* - We can not hold a vnode lock while we do a lookup. Search for and loadjeff2006-02-221-19/+25
| | | | | | | | | | | modules prior to looking up the directory which we will cover to avoid this problem in mount. - We must hold the coveredvp locked before we can busy the mountpoint to prevent a lock order reversal with the vfs_busy() in lookup which holds the directory lock prior to doing a vfs_busy(). The directory lock is required to safely clear the v_mountedhere field on the directory. MFC After: 1 week
* - Grab a mnt ref in vfs_busy() before dropping the interlock. This willjeff2006-02-221-1/+6
| | | | | | | | prevent the mount point from going away while we're waiting on the lock. The ref does not need to persist once we have the lock because the lock prevents the mount point from being unmounted. MFC After: 1 week
* - Hold the vnode used in the statfs related functions until we're done withjeff2006-02-222-42/+56
| | | | | | | | the VFS_STATFS call to prevent the mount from disappearing while we're stating. - Convert these routines to use MPSAFE namei semantics. MFC After: 1 week
* - spell VOP_LOCK(vp, LK_RELEASE... VOP_UNLOCK(vp,... so that asserts injeff2006-02-221-7/+8
| | | | | | | | | | | vop_lock_post do not trigger. - Rearrange null_inactive to null_hashrem earlier so there is no chance of finding the null node on the hash list after the locks have been switched. - We should never have a NULL lowervp in null_reclaim() so there is no need to handle this situation. panic instead. MFC After: 1 week
* - Assert that the lowervp is locked in null_hashget().jeff2006-02-221-26/+21
| | | | | | | | | | - Simplify the logic dealing with recycled vnodes in null_hashget() and null_hashins(). Since we hold the lower node locked in both cases the null node can not be undergoing recycling unless reclaim somehow called null_nodeget(). The logic that was in place was not safe and was essentially dead code. MFC After: 1 week
* - Using LK_NOWAIT in qsync() can get us into infinite loop situations thatjeff2006-02-221-1/+1
| | | | | | lead to deadlocks. Remove it. MFC After: 1 week
* - Deadfs should not use the std GETWRITEMOUNT routine. Add one that alwaysjeff2006-02-221-0/+14
| | | | | | returns NULL. MFC After: 1 week
* Remove commented out qualifier to dumping a message.mjacob2006-02-221-2/+2
|
* Abstract function mqfs_create_node() to create a mqueue node.davidxu2006-02-221-67/+76
|
* If block size is zero, use normal file operations to do I/O,davidxu2006-02-221-0/+3
| | | | | | this eliminates a divided-by-zero fault. Recommended by: phk
* honor user-specified key index for global key slotssam2006-02-211-0/+6
| | | | | | Submitted by: Joe Love Reviewed by: avatar MFC after: 1 week
* Lock the vm_object while checking its type to see if it is a vnode-backedjhb2006-02-211-11/+25
| | | | | | | | | | | object that requires Giant in vm_object_deallocate(). This is somewhat hairy in that if we can't obtain Giant directly, we have to drop the object lock, then lock Giant, then relock the object lock and verify that we still need Giant. If we don't (because the object changed to OBJT_DEAD for example), then we drop Giant before continuing. Reviewed by: alc Tested by: kris
* Move the ruadd() in kern_exit() to save our final stats in our childjhb2006-02-211-2/+3
| | | | | | | stats even further down in exit1() so that it includes the runtime and tick counts from the final time slice for the dying thread. Reviewed by: phk
* Split calcru() back into a calcru1() function shared with calccru() andjhb2006-02-211-10/+33
| | | | | | | | | | a calcru() wrapper that passes a local rusage_ext on the stack that is a snapshot to do the calculations on. Now we can pass p->p_crux to calcru1() in calccru() again which fixes the issues with runtime going backwards messages when dead processes are harvested by init. Reviewed by: phk Tested by: Stefan Ehmann shoesoft at gmx dot net
* - In the interrupt handler clear the interrupt source flags beforemarius2006-02-212-34/+48
| | | | | | | | | | | | | | | | | | | processing the interrupt events. If we clear them afterwards we can completely miss some events as the NIC can change the source flags while we're in the handler. In order to not get another interrupt while we're in ifp->if_input() with the driver lock dropped we now turn off NIC interrupts while in the interrupt handler. Previously this was meant to be achieved by clearing the interrupt source flags after processing the interrupt events but didn't really work as clearing these flags doesn't actually acknowledge and re-enable the events. This fixes the device timeouts seen with the VMware LANCE. - Relax the watchdog timer somewhat; don't enable it until the last packet is enqueued and if there is a TX interrupt but there are still outstanding ones reload the timer. Reported and tested by: Morten Rodal <morten@rodal.no> MFC after: 3 days
* Clear csum_flags after reading data from socket buffer. Otherwise,ru2006-02-211-0/+1
| | | | | | | | if ksocket is connected to an interface-type node somewhere later in the graph (e.g., ng_eiface or ng_iface), the csum_data may be applied to a wrong packet (if we encapsulate Ethernet or IP). MFC after: 3 days
* Initialize the port_bst and port_bsh variables.nyan2006-02-211-0/+2
| | | | | | | | The ed driver on pc98 was broken by if_edvar.h rev1.31. Reported by: Kaho Toshikazu (kaho at elam kais kyoto-u ac jp) Tested by: Eiji Kato (ekato at a1 mbn or jp) MFC after: 3 days
* Remove unused variable.njl2006-02-211-2/+0
| | | | | Coverity ID: 558 Found by: Coverity Prevent
* Remove unused variable.njl2006-02-211-2/+0
| | | | | Coverity ID: 548 Found by: Coverity Prevent
* Remove unused variable.njl2006-02-211-2/+0
| | | | | Coverity ID: 546 Found by: Coverity Prevent
* correct check for whether wpa is enabledsam2006-02-201-1/+1
| | | | MFC after: 3 days
OpenPOWER on IntegriCloud