summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* Bump the maximum number of levels to 64 and add warning messages aboutnjl2005-02-241-5/+15
| | | | what to do to fix reduced functionality if the number of levels is too low.
* change m_adj to reclaim unused mbufs instead of zero'ing m_lensam2005-02-241-2/+4
| | | | | | | | when trim'ing space off the back of a chain; this is indirect solution to a potential null ptr deref Noticed by: Coverity Prevent analysis tool (null ptr deref) Reviewed by: dg, rwatson
* Add locking assertions into vn_extattr_set, vn_extattr_get andcsjp2005-02-241-0/+6
| | | | | | | | vn_extattr_rm. This is meant to catch conditions where IO_NODELOCKED has been specified without the vnode being locked. Discussed with: rwatson MFC after: 1 week
* Drop bzero and shove the responsibility of zeroing the kse upcallcsjp2005-02-241-2/+1
| | | | | | | | | | | object on to the zone allocator. It should be noted that uma_zalloc(9) uses bzero to zero out the object so there probably wont be any real performance benefit. If UMA grows the ability to supply zeroed zones more efficiently in the future, we will not have to modify all the existing consumers. Discussed with: rwatson,julian MFC after: 1 week
* remove dead codesam2005-02-231-4/+0
| | | | | Noticed by: Coverity Prevent analysis tool Reviewed by: silby
* eliminate potential null derefsam2005-02-231-1/+0
| | | | | Noticed by: Coverity Prevent analysis tool Reviewed by: jhb
* - Enable SMP VFS by default on current. More users are needed to turn upjeff2005-02-231-1/+5
| | | | | | | any remaining bugs. Anyone inconvenienced by this can still disable it in the loader. Sponsored by: Isilon Systems, Inc.
* - A test in sched_switch() is no longer necessary and it is incorrectjeff2005-02-231-2/+0
| | | | | | when td0 is preempted before it voluntarily switches. Discovered by: Arjan Van Leeuwen <avleeuwen@gmail.com>
* kill dead codesam2005-02-231-7/+1
| | | | Noticed by: Coverity Prevent analysis tool
* - Only the xlock holder should be calling VOP_LOCK on a vp once VI_XLOCKjeff2005-02-231-0/+5
| | | | | | | has been set. Assert that this is the case so that we catch filesystems who are using naked VOP_LOCKs in illegal cases. Sponsored by: Isilon Systems, Inc.
* - Add a check for xlock in vop_lock_assert. Presently the xlock isjeff2005-02-221-1/+2
| | | | | | | considered to be as good as an exclusive lock, although there is still a possibility of someone acquiring a VOP LOCK while xlock is held. Sponsored by: Isilon Systems, Inc.
* Zero the v_un container field to make sure everything is gone.phk2005-02-221-1/+1
|
* Reap more benefits from DEVFS:phk2005-02-222-15/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | List devfs_dirents rather than vnodes off their shared struct cdev, this saves a pointer field in the vnode at the expense of a field in the devfs_dirent. There are often 100 times more vnodes so this is bargain. In addition it makes it harder for people to try to do stypid things like "finding the vnode from cdev". Since DEVFS handles all VCHR nodes now, we can do the vnode related cleanup in devfs_reclaim() instead of in dev_rel() and vgonel(). Similarly, we can do the struct cdev related cleanup in dev_rel() instead of devfs_reclaim(). rename idestroy_dev() to destroy_devl() for consistency. Add LIST_ENTRY de_alias to struct devfs_dirent. Remove v_specnext from struct vnode. Change si_hlist to si_alist in struct cdev. String new devfs vnodes' devfs_dirent on si_alist when we create them and take them off in devfs_reclaim(). Fix devfs_revoke() accordingly. Also don't clear fields devfs_reclaim() will clear when called from vgone(); Let devfs_reclaim() call dev_rel() instead of vgonel(). Move the usecount tracking from dev_rel() to devfs_reclaim(), and let dev_rel() take a struct cdev argument instead of vnode. Destroy SI_CHEAPCLONE devices in dev_rel() (instead of devfs_reclaim()) when they are no longer used. (This should maybe happen in devfs_close() instead.)
* Make dev_ref() require the dev_lock() to be held and use it fromphk2005-02-221-2/+1
| | | | devfs instead of directly frobbing the si_refcount.
* Remove vfinddev(), it is generally bogus when faced with jails andphk2005-02-221-20/+0
| | | | chroot and has no legitimate use(r)s in the tree.
* When invoking callout_init(), spell '1' as "CALLOUT_MPSAFE".rwatson2005-02-221-1/+1
| | | | MFC after: 3 days
* In the current world order, solisten() implements the state transition ofrwatson2005-02-212-23/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a socket from a regular socket to a listening socket able to accept new connections. As part of this state transition, solisten() calls into the protocol to update protocol-layer state. There were several bugs in this implementation that could result in a race wherein a TCP SYN received in the interval between the protocol state transition and the shortly following socket layer transition would result in a panic in the TCP code, as the socket would be in the TCPS_LISTEN state, but the socket would not have the SO_ACCEPTCONN flag set. This change does the following: - Pushes the socket state transition from the socket layer solisten() to to socket "library" routines called from the protocol. This permits the socket routines to be called while holding the protocol mutexes, preventing a race exposing the incomplete socket state transition to TCP after the TCP state transition has completed. The check for a socket layer state transition is performed by solisten_proto_check(), and the actual transition is performed by solisten_proto(). - Holds the socket lock for the duration of the socket state test and set, and over the protocol layer state transition, which is now possible as the socket lock is acquired by the protocol layer, rather than vice versa. This prevents additional state related races in the socket layer. This permits the dual transition of socket layer and protocol layer state to occur while holding locks for both layers, making the two changes atomic with respect to one another. Similar changes are likely require elsewhere in the socket/protocol code. Reported by: Peter Holm <peter@holm.cc> Review and fixes from: emax, Antoine Brodin <antoine.brodin@laposte.net> Philosophical head nod: gnn
* When aborting a UNIX domain socket bind() because VOP_CREATE() failed,rwatson2005-02-211-1/+3
| | | | | | make sure to call vn_finished_write(mp) before returning. MFC after: 3 days
* style(9)-ize function headers, remove use of 'register'.rwatson2005-02-201-59/+30
| | | | MFC after: 3 days
* Remove VFS_START(). Its original purpose involved the mfs filesystem,das2005-02-203-17/+1
| | | | | | | which is long gone. Discussed with: mckusick Reviewed by: phk
* In unp_attach(), allow uma_zalloc to zero the new unpcb rather thanrwatson2005-02-201-3/+2
| | | | | | | | explicitly using bzero(). Update copyright. MFC after: 3 days
* Prefer NULL to returning 0 cast to a pointer type.rwatson2005-02-202-6/+6
| | | | MFC after: 3 days
* In soreceive(), when considering delivery to a socket in SS_ISCONFIRMING,rwatson2005-02-201-1/+2
| | | | | | | | only call the protocol's pru_rcvd() if the protocol has the flag PR_WANTRCVD set. This brings that instance of pru_rcvd() into line with the rest, which do check the flag. MFC after: 3 days
* Move assignment of UNIX domain socket pcb during unp_attach() outsiderwatson2005-02-201-1/+1
| | | | | | | of the global UNIX domain socket mutex: no protection is needed that early in the setup of the UNIX domain socket and socket structures. MFC after: 3 days
* Add the "freq_settings" sysctl to each device that registers with cpufreqnjl2005-02-201-0/+41
| | | | so their individual settings can be seen separately for debugging.
* Try to unbreak the vnode locking around vop_reclaim() (based mostly onphk2005-02-191-36/+30
| | | | | | | | | patch from kan@). Pull bufobj_invalbuf() out of vinvalbuf() and make g_vfs call it on close. This is not yet a generally safe function, but for this very specific use it is safe. This solves the problem with buffers not being flushed by unmount or after failed mount attempts.
* Don't restart a timeout wait in kern_sigtimedwait, also allow itdavidxu2005-02-191-11/+27
| | | | to wait longer than a single integer can represent.
* Swap the arguments for CP so we copy the correct source andps2005-02-181-4/+4
| | | | destination.
* Remove now unused 'int s' from spl().rwatson2005-02-181-1/+1
| | | | MFC after: 3 days
* De-spl kern_connect().rwatson2005-02-181-2/+0
| | | | MFC after: 3 days
* Correct a typo in the comment describing soreceive_rcvoob().rwatson2005-02-181-1/+1
| | | | MFC after: 3 days
* In soconnect(), when resetting so->so_error, the socket lock is notrwatson2005-02-181-2/+0
| | | | | required due to a straight integer write in which minor races are not a problem.
* Re-style do_setopt_accept_filter() to match uipc_accf.c style, and fixrwatson2005-02-181-8/+6
| | | | | | one other style nit in the file. MFC after: 3 days
* Move do_setopt_accept_filter() from uipc_socket.c to uipc_accf.c, whererwatson2005-02-182-126/+120
| | | | | | the rest of the accept filter code currently lives. MFC after: 3 days
* Minor style tweaks: line wrap comments and lines more consistently.rwatson2005-02-181-9/+9
| | | | MFC after: 3 days
* Re-order checks in socheckuid() so that we check all deny cases beforerwatson2005-02-181-3/+3
| | | | | | returning accept. MFC after: 3 days
* Make sure to drop the VI_LOCK in vgonel();phk2005-02-181-1/+3
| | | | Spotted by: Taku YAMAMOTO <taku@tackymt.homeip.net>
* In solisten(), unconditionally set the SO_ACCEPTCONN option inrwatson2005-02-181-6/+4
| | | | | | | | | | | | | | | | | | | | so->so_options when solisten() will succeed, rather than setting it conditionally based on there not being queued sockets in the completed socket queue. Otherwise, if the protocol exposes new sockets via the completed queue before solisten() completes, the listen() system call will succeed, but the socket and protocol state will be out of sync. For TCP, this didn't happen in practice, as the TCP code will panic if a new connection comes in after the tcpcb has been transitioned to a listening state but the socket doesn't have SO_ACCEPTCONN set. This is historical behavior resulting from bitrot since 4.3BSD, in which that line of code was associated with the conditional NULL'ing of the connection queue pointers (one-time initialization to be performed during the transition to a listening socket), which are now initialized separately. Discussed with: fenner, gnn MFC after: 3 days
* Introduce a new method, cpufreq_drv_type(), that returns the type of thenjl2005-02-182-6/+15
| | | | | | | | | | | driver. This used to be handled by cpufreq_drv_settings() but it's useful to get the type/flags separately from getting the settings. (For example, you don't have to pass an array of cf_setting just to find the driver type.) Use this new method in our in-tree drivers to detect reliably if acpi_perf is present and owns the hardware. This simplifies logic in drivers as well as fixing a bug introduced in my last commit where too many drivers attached.
* In accept1(), extend coverage of the socket lock from just coveringrwatson2005-02-171-2/+2
| | | | | | | | | | soref() to also covering the update of so_state. While no other user threads can update the socket state here as it's not yet hooked up to the file descriptor array yet, the protocol could also frob the socket state here, leading to a lost update to the so_state field. No reported instances of this bug (as yet). MFC after: 3 days
* In sonewconn(), set the new socket's state to show the protocol-providedrwatson2005-02-172-2/+2
| | | | | | | | | | | connection status before inserting the new socket into the listen socket's accept queue, or there might be a race in which another thread wakes up when the accept lock is released, and sees the socket before its state is set correctly. The wakeup still occurs after the accept lock is released. There have been no diagnoses of this bug in real-world systems (as yet). MFC after: 3 days
* Introduce vx_wait{l}() and use it instead of home-rolled versions.phk2005-02-172-8/+32
|
* Convert KASSERTS to VNASSERTSphk2005-02-171-22/+27
|
* Add /rescue/init to the default init_path, before /stand/sysinstall.des2005-02-171-1/+1
| | | | MFC after: 2 weeks
* Well, it seems that I pre-maturely removed the "All rights reserved"bmilekic2005-02-161-2/+2
| | | | | | | | | | | | | | statement from some files, so re-add it for the moment, until the related legalese is sorted out. This change affects: sys/kern/kern_mbuf.c sys/vm/memguard.c sys/vm/memguard.h sys/vm/uma.h sys/vm/uma_core.c sys/vm/uma_dbg.c sys/vm/uma_dbg.h sys/vm/uma_int.h
* When dealing with systems with no absolute drivers attached, only calibratenjl2005-02-151-10/+22
| | | | | | | the rate for the 100% state once. Afterwards, use that value for deriving states. This should fix the problem where the calibrated frequency was different once a switch was done, giving a different set of levels each time. Also, properly search for the right cpufreqX device when detaching.
* Bind to the driver's parent cpu before switching, for both absolute andnjl2005-02-151-18/+28
| | | | | relative drivers. Remove some extraneous KASSERTs since NULL pointers will be found when they're used right afterwards.
* Implement priorities. This allows a driver (say, for cooling purposes) tonjl2005-02-141-4/+38
| | | | | | | override the current freq level temporarily and restore it when the higher priority condition is past. Note that only the first overridden value is saved. Callers pass NULL to CPUFREQ_SET to restore the saved level. Priorities are not yet used so this commit should have no effect.
* Add support for the CPUFREQ_FLAG_INFO_ONLY flag. Devices that report thisnjl2005-02-131-1/+8
| | | | | | | | | | | are not added to the list(s) of available settings. However, other drivers can call the CPUFREQ_DRV_SETTINGS() method on those devices directly to get info about available settings. Update the acpi_perf(4) driver to use this flag in the presence of "functional fixed hardware." Thus, future drivers like Powernow can query acpi_perf for platform info but perform frequency transitions themselves.
* Backout addition of SIGTHR into the list of signals allowed to be deliveredsobomax2005-02-131-1/+0
| | | | | | to the suid/sugid process, since apparently it has security implications. Suggested by: rwatson
OpenPOWER on IntegriCloud