Commit Graph

4484 Commits

Author SHA1 Message Date
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
cube
cb6200f890 Remove bogus XXX comment: a.msg doesn't point to stack data. 2005-12-14 15:27:59 +00:00
cube
ae544644cf Fix typo in previous commit. 2005-12-14 15:23:00 +00:00
reinoud
d3857d0bd2 Fix disklabel recognition code for mbr based systems like i386. It would
return NULL even though no disklabel was found making callers assume that a
valid disklabel WAS found but instead were presented by the dummy disklabel
that is created.

If the rval is SCAN_CONTINUE it now returns a standard error that no
disklabel was found instead of the NULL.
2005-12-14 15:01:03 +00:00
yamt
78bf100dce simplify rev.1.68 and fix EINVAL problem. add a comment. PR/32224. 2005-12-14 01:58:01 +00:00
reinoud
255662c92a Fix of panic that was introduced since ktrace-lwp branch was merged. The
shortcut to the process of the passed lwp paniced the kernel since lwp
could/can be passwd as NULL in VOP_WRITE().

This was happening when ktracing to NFS. The function ktrwrite() set the
uio_lwp to NULL and then calls VOP_WRITE() with this argument. nfs_write()
then accessed lwp *l->l_proc wich paniced.

Thanks to David Laight for his help on tracking it down.
2005-12-13 13:12:18 +00:00
yamt
0a40fe5a5e physio: deal with unaligned buffers/small maxphys/overlapped buffers.
fix PR/32224 from Matthias Scheler.
(uvm_vslock needs to be redesigned for threaded applications.
but it's a different problem.)
2005-12-13 12:29:32 +00:00
elad
6590e0e201 Catch up with ktrace-lwp merge.
While I'm here, stop using cur{lwp,proc}.
2005-12-12 16:26:33 +00:00
skrll
c9e1574d35 Get correct Ids after ktrace-lwp merge. 2005-12-11 13:02:20 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00