Commit Graph

7542 Commits

Author SHA1 Message Date
hannken
916ee575ee brelsel: Clear B_COWDONE flag on clean (! BO_DELWRI) buffer. B_COWDONE is set
if the buffer was read with intention to modify but the caller changed its mind.

This error could lead to snapshot corruption when a buffer with B_COWDONE set
resides on the freelist and we create a new snapshot.
2010-12-12 10:30:09 +00:00
matt
b7a7b9b8bc Make sure all for loops use { } 2010-12-11 22:32:13 +00:00
matt
dc55b48ba8 Add evcnt_attach_dynamic_nozero, a version of evcnt_attach_dynamic, which
doesn't zero the evcnt before filling in things.  This is needed when the
evcnt itself is being updated before evcnt_attach_dynamic can be called.
2010-12-11 22:30:54 +00:00
matt
e66ccad2ea Add critpoll (critical polling) hooks. These are keep things like watchdogs
from firing when the system is doing stuff like waiting at a ddb prompt or
the kernel is doing a lot of printing.
2010-12-11 22:27:53 +00:00
dholland
14402d0ff1 Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.
2010-11-30 10:43:01 +00:00
dholland
d4eb05390d Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.
2010-11-30 10:29:57 +00:00
jnemeth
22405528a4 Rename the autoloaded property list from <module>.prop to <module>.plist
as discussed on tech-kern.
2010-11-28 00:26:38 +00:00
cegger
0afb168c64 No need to print '0x' twice in the printing of
the mbuf flags via 'show mbuf'
2010-11-24 14:49:18 +00:00
pooka
dbb937f216 _KERNEL_OPT 2010-11-21 17:57:24 +00:00
dholland
8f6ed30d57 Introduce struct pathbuf. This is an abstraction to hold a pathname
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.

Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).

The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.
2010-11-19 06:44:33 +00:00
jnemeth
fd3014ea71 if autoloading check for a noautoload=true property and if found,
deny the autoload
2010-11-18 09:50:47 +00:00
pooka
b991c38551 Skip one extra function in the rump syscall local path and use
sy_call() directly from rump_syscalls.c.
2010-11-17 21:47:11 +00:00
dholland
06a95d4af1 typo in comment 2010-11-17 20:07:50 +00:00
dyoung
64f588a45a Fix a bug in ptcread() that stopped a pty(4) in TIOCPKT_IOCTL mode from
sending a termios(4) structure like it was supposed to: ptcread() used
to copy pti->pt_send and zero it before testing it for TIOCPKT_IOCTL.
Test for TIOCPKT_IOCTL in the pti->pt_send copy in local variable c
instead of in pti->pt_send itself.
2010-11-16 23:58:11 +00:00
pooka
0061495240 rump posix_fadvise() 2010-11-11 14:47:41 +00:00
yamt
b31dca7b14 vclean: fix a bug which makes getcleanvnode always cause VOP_INACTIVE. 2010-11-11 13:58:58 +00:00
hannken
c7919375e5 Change md(4) to:
- create md devices on first open and destroy on last close.
- add enough disk label support to make DIOCGDINFO and DIOCGPART work.
- add disk_busy()/disk_unbusy() instrumentation.

Ok: David Young <dyoung@netbsd.org>
2010-11-11 11:07:06 +00:00
hannken
897bf1dab0 Wapbl_register_deallocation(): the taken reader lock is not sufficient to
protect wl_dealloc* members.  Take the mutex here and change the lock
requirements of these fields to "writer lock or mutex".

This error lead to file system corruption and "freeing free block" panics.
2010-11-09 16:30:26 +00:00
pooka
c099830b29 Create rump_syscalls.c in two flavours: one which can be compiled
standalone as the clientside and one which expects to be compiled
into the rump kernel.
2010-11-04 20:50:29 +00:00
pooka
3c0f9a592b apply "shut up, lint" for syscallargs.h 2010-11-04 17:02:34 +00:00
dyoung
ac87baf848 usb_port.h was deleted, no need to skip it when computing tags. 2010-11-04 03:15:50 +00:00
pooka
37653ea90a KASSERT we don't kpause indefinitely without interruptability.
XXX: using timo == 0 to mean "sleep as long as you like, and forever
if you're really tired" is not the smartest interface considering
the the hz/n idiom used to specify timo.  This leads to unwanted
behaviour when hz gets below some impossible-to-know limit.  With
a usec2ticks() routine it at least be a little more tolerable.
2010-11-02 15:17:37 +00:00
pooka
7d421d6903 Don't sleep forever if hz < 25.
from Alessandro Forin
2010-11-02 15:09:52 +00:00
pooka
8553c5887b Align comment column in output, no functional change. 2010-11-01 16:21:29 +00:00
pooka
41a10084d4 Attach implicit threads to initproc instead of proc0. This way
applications which alter, by purpose or by accident, the uid in an
implicit thread are don't affect kernel threads.

from discussion with njoly
2010-10-29 15:32:23 +00:00
pooka
ff08ca3b05 Zero entire stat structure before filling in contents to avoid
leaking kernel memory -- the elements are no longer packed now that
dev_t is 64bit.

from pgoyette
2010-10-28 20:32:45 +00:00
seanb
49025bce19 Always use m_split() in m_copyback() instead of its
local, abridged, version.  This closes a window where
a new mbuf (n) can be inserted where n->m_next == n.
2010-10-28 14:21:50 +00:00
rmind
366aa69d08 do_posix_fadvise: check for a negative length; truncate the offset and
round the end-offset, not vice-versa.

Thanks to jakllsch@ for debug info.
2010-10-27 02:58:04 +00:00
yamt
65656eb8a2 unp_connect: fix an assertion 2010-10-21 11:14:39 +00:00
yamt
6c0992266e unp_connect2: fix a comment. 2010-10-21 11:13:43 +00:00
chs
596908f5cf when using ktrace format version 0 or 1, don't adjust the changed fields
in ktealloc(), since we do the same adjustment later in ktrwrite().
also, remove an unused variable in ktr_csw().
2010-10-18 00:09:13 +00:00
pgoyette
1e25563ccb Remove double-inclusion of <sys/kauth.c> 2010-10-16 18:09:02 +00:00
rmind
0698446b8c Re-enable direct select. 2010-10-15 05:39:19 +00:00
oki
e3731ae5b2 Wait for freeing mbuf cluster in sosend() causes freeze network stack.
Don't wait for it.
problem was found by iij seil team.
it is similar to OpenBSD uipc_socket.c rev.1.72.
2010-10-14 03:07:51 +00:00
mrg
3eca36b665 add some (uint64_t) casts so avoid 32 bit overflows. this fixes my
3TB disk with 4KB sectors and disklabel (which looks like it would
work upto 16TB.)

idea from mlelstv@.
2010-10-14 00:47:16 +00:00
chs
79f3dfff82 when we use a fake data section, make sure that the start is page-aligned. 2010-10-07 02:14:02 +00:00
matt
19e6c76b2d Rename rb.h to rbtree.h, as it is more appropriate (c.f. ptree.h). Also
helps find code that hasn't been updated to use the new rbtree API.
2010-09-25 01:42:38 +00:00
rmind
879d5dfb5e Fixes/improvements to RB-tree implementation:
1. Fix inverted node order, so that negative value from comparison operator
   would represent lower (left) node, and positive - higher (right) node.
2. Add an argument (i.e. "context"), passed to comparison operators.
3. Change rb_tree_insert_node() to return a node - either inserted one or
   already existing one.
4. Amend the interface to manipulate the actual object, instead of the
   rb_node (in a similar way as Patricia-tree interface does).
5. Update all RB-tree users accordingly.

XXX: Perhaps rename rb.h to rbtree.h, since cleaning-up..

1-3 address the PR/43488 by Jeremy Huddleston.

Passes RB-tree regression tests.
Reviewed by: matt@, christos@
2010-09-24 22:51:50 +00:00
chs
38b9dc3505 implement O_DIRECTORY as standardized in POSIX-2008,
for both native and linux emulations.
this fixes the rest of PR 43695.
2010-09-21 19:26:18 +00:00
drochner
29d1b2938d improve "const" consistency 2010-09-12 16:06:08 +00:00
chs
590b90699b always supply an auxiliary vector for linux ELF processes.
static executables (such as newer versions of /sbin/ldconfig)
require this to work properly.  since static executables
also don't have a PT_PHDR entry, use the same heuristic as
linux does to provide a value for AT_PHDR in this case.
2010-09-11 20:49:28 +00:00
drochner
51b3e42a8d make list traversing in knote() safe against removal of the entry
while the loop body is executed -- at least in the EVFILT_PROC / exit
case a race condition exists which can cause this
fixes a panic triggered eg by tests/kernel/kqueue/proc1
2010-09-10 10:23:46 +00:00
drochner
3ebe07497e fix two bugs reported by Ryo Shimizu:
-wrong initialization reported in a followup to PR bin/43336
 (looks harmless because it applies to zero-initialized memory, so
 LIST_INIT() is a no-op)
-wrong loop count in reply misses a hash bucket (PR kern/43827)
 (this was introduced by a post-netbsd-5 change, so it isn't related
 to the PR above)
2010-09-10 10:14:55 +00:00
joerg
b5e51c26bb Remember the end of the last text segment and set up a fake data segment
if size 0 and starting after the text segments, if no data segment was
found. Unbreaks sbrk on platforms where all loaded segments are
executable (PR 43817). The cast of executable segments after data
segments is left out for now.
2010-09-07 21:32:03 +00:00
pooka
0d2a7de3b6 getcwd for rump 2010-09-07 17:10:08 +00:00
pooka
a50c905497 rump umask 2010-09-06 20:00:09 +00:00
dyoung
c3438d26de Cosmetic: remove unnecessary parenthesization in return statements.
Don't "test truth" of ints, but compare with 0, instead.

The generated assembly is the same before & after this change.
2010-09-05 18:03:37 +00:00
pooka
0af65acdc5 Actually, the comment probably meant "would be nice to KASSERT here,
but can't".  So turn it into a KASSERT now that it's possible.
2010-09-01 15:15:18 +00:00
pooka
8411fe4cea Remove XXX comment. I'm not sure what it precisely means, but I'm
guessing it's from a time when rump used filedesc0 for everything
(and that isn't true anymore).
2010-09-01 15:12:16 +00:00
pooka
72a4517ea3 regen: rump syscalls for kern_prot interfaces 2010-08-30 10:34:51 +00:00