Commit Graph

4493 Commits

Author SHA1 Message Date
yamt d9b9d1ddc8 falloc: grab fd_slock when calling fd_unused. 2006-01-31 14:02:10 +00:00
dsl db0d69832d Improve disk portability between systems.
- Always look for labels in the first two sectors
- Update all existing labels, but only write new labels to netbsd mbr
  partitions, and the first/second sector of disks that don't have an mbr.
Moving disks between systems still sucks bigtime!
- raw patition is either c or d, if d then c is reserved
- max partitions might be 8 or 16, nothing in the label gives the maximum
- endianness
2006-01-28 19:57:07 +00:00
darrenr 5987976cc1 if db_onpanic is -1, do not invoke any ddb functions at all when handling
a panic.  This allows ddb's behaviour on a panic to be controlled via
sysctl rather than just compiling it in/out.
2006-01-28 14:37:31 +00:00
darrenr 76f9e99eec Introduce a new style of behaviour for ddb_onpanic == 2.
When set to 0 or 1, behaviour is normal (today)
When set to 2, kernel will display a stack trace and then enter ddb.
2006-01-28 07:23:37 +00:00
elad 2f934347d3 remove security node sysctl objects; they are now created using CTL_CREATE. 2006-01-27 03:14:56 +00:00
christos dfd8bc48f7 PR/32631: Yves-Emmanuel JUTARD: Fix DIAGNOSTIC panic in the pool code. At
the time pool_get() calls pool_catchup(), pp has been free'd but it is still
in the "entered" state. The chain pool_catchup() -> pool_allocator_alloc()
-> pool_reclaim() on pp fails because pp is still in the "entered" state.
Call pr_leave() before calling calling pool_catchup() to avoid this.

Thanks for the excellent analysis!
2006-01-26 15:07:25 +00:00
christos e7e64b6ab3 PR/32630: Yves-Emmanuel JUTARD: Illegal return in sys/kern/uipc_mbuf2.c.
Gcc likes return (void), but other compilers disagree.
2006-01-25 16:21:39 +00:00
yamt e8a3b3eb83 add ddb "sh mbuf" command. 2006-01-24 13:02:57 +00:00
uwe a881c52408 Rewrite to support LINTSTUB in multiline comments.
Be more flexible in what we accept as a valid LINTSTUB directive.
Don't abort on first error.

Separate LINTSTUB comments look ugly if the function/variable already
has a descriptive comment.  People don't like to write ugly code.
Now one can write:

/*
 * LINTSTUB: Func: type function(args)
 *    Some descriptive comment about the function.
 */
2006-01-22 05:11:11 +00:00
reinoud 0071238956 Propagate an appropiate error code in nestiobuf_iodone() to the master
buffer when the passed nested buffer has no B_ERROR flag set but not all
was transfered for the nested iobuf extent.

Discussed on tech-kern and ok'd by Takashi
2006-01-21 14:09:35 +00:00
yamt 6f3f9a8f52 blst_meta_fill: fix an assertion. PR/32580 from Nick Hudson. 2006-01-20 14:19:40 +00:00
reinoud 6e09afa9be vfs_mountedon() can only and only handle special device nodes and will
otherwise generate an UVM trap or will access random memory. This is due to
the dereference of vp->v_specmountpoint that is really
vp->v_specinfo->si_mountpoint. The field v_specinfo is multiplexed with
other structs in the vun union in struct vnode like struct socket.

The patch adds a sanity check for accessing the specinfo fields by only
allowing VBLK nodes to be passed. In theory also VCHR could be valid since
its also a special node though mounting is only done on VBLK so be strict.

Ok'd by yamt.
2006-01-18 14:26:55 +00:00
yamt dae53410a7 - tweak RUN_ONCE api to allow init_func returns an error.
- physio: handle failure of workqueue_create.
2006-01-16 21:45:38 +00:00
yamt 330b298a42 make some functions static. 2006-01-16 21:44:46 +00:00
yamt 926005485e allocbuf: yield cpu in a loop. 2006-01-15 09:01:02 +00:00
yamt 3856e837b5 - use POOL_INIT for bufpool.
- make bufiopool static.
2006-01-15 08:27:07 +00:00
yamt db2c8f4e34 add nestiobuf api for convenience when splitting a request to several pieces. 2006-01-11 00:44:41 +00:00
yamt 2addc3084c remove B_EINTR as it isn't used anymore. 2006-01-07 00:26:58 +00:00
yamt 6d5ea6e27c use a dedicated buf pool for getiobuf. 2006-01-05 10:18:20 +00:00
yamt 690d424f28 - add simple functions to allocate/free a buffer for i/o.
- make bufpool static.
2006-01-04 10:13:05 +00:00
yamt 46a5c6f4e8 vn_lock: LK_CANRECURSE is used by layered filesystems. pointed by cube@. 2006-01-01 16:45:42 +00:00
yamt bcb3f4c7e6 vn_lock: assert that only a limited set of LK_* flags is used. 2005-12-31 14:33:13 +00:00
yamt 7d89e7d9e9 checkalias: redo rev.1.231 differently.
check v_specinfo rather than using LK_SLEEPFAIL.
2005-12-31 14:05:01 +00:00
yamt 98f56ad82e regen. 2005-12-30 11:19:26 +00:00
yamt e6faff5a45 remove a wrong "LOCKED=YES" from vop_bmap. pointed by Reinoud Zandijk. 2005-12-30 11:19:09 +00:00
chs 89a8f7b8c9 change errors returned for various operations on "/" to conform to SUSv3.
as discussed on tech-kern some time back.
2005-12-27 17:24:07 +00:00
jmmv d9585f8d92 Improve a comment in the patch I sent (handle DM6 DDO partition) based
on hubertf@'s comments.  Hmm...  I didn't even notice this was already
committed.
2005-12-27 15:45:09 +00:00
chs 0545b6e0cb changes for making DIAGNOSTIC not change the kernel ABI:
- for structure fields that are conditionally present,
   make those fields always present.
 - for functions which are conditionally inline, make them never inline.
 - remove some other functions which are conditionally defined but
   don't actually do anything anymore.
 - make a lock-debugging function conditional on only LOCKDEBUG.

as discussed on tech-kern some time back.
2005-12-27 04:06:45 +00:00
chs 688c44a9a0 hold kernel_lock while calling printf() in scdebug_*. 2005-12-27 00:28:08 +00:00
chs 36bb975558 hold kernel_lock while calling systrace_exit().
fixes PR 25856.
2005-12-27 00:27:34 +00:00
chs 0c8753dfd8 in systrace_make_msg(), sleep uninterruptibly while waiting for
the response from the systrace daemon, so that the message protocol
between the kernel and the daemon doesn't get out of sync.
fixes PR 29654.
2005-12-27 00:26:58 +00:00
yamt 3e450009f4 socreate: fix a null dereference on nfs reconnect, introduced by ktrace-lwp. 2005-12-27 00:00:29 +00:00
perry 144515ce1a u_intN_t -> uintN_t 2005-12-26 18:41:36 +00:00
christos ddeaed4040 don't hard-code 63. 2005-12-26 16:11:04 +00:00
christos 4ead7c35d9 Julio M. Merino Vidal: Patch to recognize and automatically skip the Ontrack
Disk Manager drivers.
2005-12-26 16:08:34 +00:00
yamt 9297401d54 - add ioctls to set/get disk bufq strategy.
- implement them for some drivers.
2005-12-26 10:36:47 +00:00
yamt f9b53cfa6f bufq_alloc: return correct errors rather than 0. 2005-12-26 10:00:34 +00:00
perry a2cd732268 Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 19:12:23 +00:00
yamt 6454c469ea fix a long-standing scheduler problem that p_estcpu is doubled
for each fork-wait cycles.

- updatepri: factor out the code to decay estcpu so that it can be used
  by scheduler_wait_hook.
- scheduler_fork_hook: record how much estcpu is inherited from
  the parent process.
- scheduler_wait_hook: don't add back inherited estcpu to the parent.
2005-12-24 12:57:14 +00:00
yamt 523e856cba prevent in-core vnode being freed from getting new references.
otherwise, once the corresponding bit in the inode bitmap is cleared,
an unrelated inode with the same inode number can be allocated and
ufs_ihashget() picks a stale in-core vnode for it.

PR/32301 by Matthias Scheler.
2005-12-23 15:31:40 +00:00
rpaulo b37b6e42f6 Fix comments for preempt() using rev. 1.101.2.31 log of nathanw_sa by thorpej. 2005-12-20 19:26:15 +00:00
christos 7799813507 Commit temporary fix against kva starvation from yamt:
- pool_allocator_alloc: drain ourselves as well,
  so that pool_cache on us is drained as well.
- pool_cache_put_paddr: destruct objects if underlying pool is starved.
- pool_get: on kva starvation, wake up once a second and try again.

Fixes:
PR/32287: Processes hang in "mclpl"
PR/32330: shark kernel hangs under memory load.
2005-12-20 15:52:14 +00:00
thorpej c97c3de6e9 Remove the tablet line discipline. 2005-12-20 05:35:27 +00:00
thorpej 88ac5a26bf Use new typedefs. 2005-12-20 04:39:36 +00:00
dsl a89c49ee25 KNF - remove the K&R function definitions 2005-12-18 17:02:45 +00:00
dsl 5f7cb96ae2 Only update partition 2 when RAW_PART is 3. 2005-12-18 16:48:06 +00:00
yamt 758ed9461b fix spurious EINVAL at end of partition.
- rather than special-caseing EINVAL,
  simply pick an error at the lowest offset.
- correct uio_resid.
- add some debug code.
2005-12-17 05:26:41 +00:00
cube c13d97c44b ktrace-lwp merge fallout. 2005-12-15 22:01:17 +00:00
yamt d369d69d2f updatepri:
- don't compare a scaled value with a unscaled value.
- actually, 7 times the loadfactor is necessary to decay p_estcpu enough,
  even before the recent p_estcpu changes.
  after the recent p_estcpu change, 8 times loadavg decay is needed.
- fix a comment to match with the recent reality.
2005-12-15 13:43:49 +00:00
dsl ae10740c03 Revert previous change.
It breaks the code that generates a default label (with partition 'a'
covering the entire volume - which is what everything expects) for disks that
don't have a NetBSD label nor an MBR, but do have a single filesytem covering
the entire volume.
2005-12-14 21:40:32 +00:00