16 years agoFix fencepost error causing creation of 0-length mbufs when
Matthew Dillon [Mon, 1 May 2006 16:26:29 +0000 (16:26 +0000)]
Fix fencepost error causing creation of 0-length mbufs when
the boundary between header and data fell on the boundary
between two mbufs.

Submitted-by: Gary Allan <dragonfly@gallan.plus.com>
Taken-from: FreeBSD4

16 years ago32bit from 64bit value fixup. Fix typo.
Matthew Dillon [Mon, 1 May 2006 16:26:09 +0000 (16:26 +0000)]
32bit from 64bit value fixup.  Fix typo.

Submitted-by: Gary Allan <dragonfly@gallan.plus.com>
Taken-from: FreeBSD4

16 years agom_cat() may free the mbuf on 2nd arg, so m_pkthdr manipulation
Matthew Dillon [Mon, 1 May 2006 16:25:41 +0000 (16:25 +0000)]
m_cat() may free the mbuf on 2nd arg, so m_pkthdr manipulation
has to happen before the call to m_cat(). [May not apply.]

Fix IPv6 error statistics being recorded as IPv4.

Submitted-by: Gary Allan <dragonfly@gallan.plus.com>
Taken-from: FreeBSD4

16 years agoPlug xform memory leaks. Don't re-initialize an xform for an SA that
Matthew Dillon [Mon, 1 May 2006 16:24:43 +0000 (16:24 +0000)]
Plug xform memory leaks. Don't re-initialize an xform for an SA that
already has one.

Add a missing 'break;'

Submitted-by: Gary Allan <dragonfly@gallan.plus.com>
Taken-from: FreeBSD4

16 years agoFix kldstat option.
Sascha Wildner [Mon, 1 May 2006 09:22:14 +0000 (09:22 +0000)]
Fix kldstat option.

16 years agoRemove ports(7) reference and reword.
Sascha Wildner [Mon, 1 May 2006 09:06:33 +0000 (09:06 +0000)]
Remove ports(7) reference and reword.

16 years agoDocument recently added devices.
Sascha Wildner [Mon, 1 May 2006 02:06:40 +0000 (02:06 +0000)]
Document recently added devices.

Submitted-by: Gary <gary@velocity-servers.net>
16 years agoAdd missing #includes.
Sascha Wildner [Mon, 1 May 2006 01:32:11 +0000 (01:32 +0000)]
Add missing #includes.

16 years agoRemove buf->b_saveaddr, assert that vmapbuf() is only called on pbuf's. Pass
Matthew Dillon [Sun, 30 Apr 2006 20:23:26 +0000 (20:23 +0000)]
Remove buf->b_saveaddr, assert that vmapbuf() is only called on pbuf's.  Pass
the user pointer and length to vmapbuf() rather then having it try to pull
the information out of the buffer.  vmapbuf() is now responsible for setting
b_data, b_bufsize, and b_bcount.

Also fix a bug in cam_periph_mapmem().  The procedure was failing to unmap
earlier vmapped bufs if later vmapbuf() calls in the loop failed.

16 years agoThe pbuf subsystem now initializes b_kvabase and b_kvasize at startup and
Matthew Dillon [Sun, 30 Apr 2006 18:52:37 +0000 (18:52 +0000)]
The pbuf subsystem now initializes b_kvabase and b_kvasize at startup and
no longer reinitializes these fields in initpbuf().

Users of getpbuf() may no longer modify b_kvabase or b_kvasize.  b_data may
still be modified.

16 years agoAdd some missing manual pages.
Sascha Wildner [Sun, 30 Apr 2006 18:46:39 +0000 (18:46 +0000)]
Add some missing manual pages.

Taken-from: FreeBSD

16 years agoRemove b_xflags. Fold BX_VNCLEAN and BX_VNDIRTY into b_flags as
Matthew Dillon [Sun, 30 Apr 2006 18:25:37 +0000 (18:25 +0000)]
Remove b_xflags.  Fold BX_VNCLEAN and BX_VNDIRTY into b_flags as
B_VNCLEAN and B_VNDIRTY.  Remove BX_AUTOCHAINDONE and recode the
swap pager to use one of the caller data fields in the BIO instead.

16 years agoReplace the the buffer cache's B_READ, B_WRITE, B_FORMAT, and B_FREEBUF
Matthew Dillon [Sun, 30 Apr 2006 17:22:18 +0000 (17:22 +0000)]
Replace the the buffer cache's B_READ, B_WRITE, B_FORMAT, and B_FREEBUF
b_flags with a separate b_cmd field.  Use b_cmd to test for I/O completion
as well (getting rid of B_DONE in the process).  This further simplifies
the setup required to issue a buffer cache I/O.

Remove a redundant header file, bus/isa/i386/isa_dma.h and merge any
discrepancies into bus/isa/isavar.h.

Give ISADMA_READ/WRITE/RAW their own independant flag definitions instead of
trying to overload them on top of B_READ, B_WRITE, and B_RAW.  Add a
routine isa_dmabp() which takes a struct buf pointer and returns the ISA
dma flags associated with the operation.

Remove the 'clear_modify' argument to vfs_busy_pages().  Instead,
vfs_busy_pages() asserts that the buffer's b_cmd is valid and then uses
it to determine the action it must take.

16 years agoAdd NetGear FA-511 support
Sepherosa Ziehau [Sun, 30 Apr 2006 02:02:06 +0000 (02:02 +0000)]
Add NetGear FA-511 support

Obtained-from: FreeBSD
Tested-by: Andrew Thompson <andrew@hijacked.us>
16 years agoBring in SHA256 support from FreeBSD.
Matthew Dillon [Sat, 29 Apr 2006 22:19:26 +0000 (22:19 +0000)]
Bring in SHA256 support from FreeBSD.

Submitted-by: Gary Allan <dragonfly@gallan.plus.com>
Taken-from: FreeBSD

16 years agoBring in some fixes from NetBSD:
Matthew Dillon [Sat, 29 Apr 2006 22:05:21 +0000 (22:05 +0000)]
Bring in some fixes from NetBSD:

- Avoid NULL pointer dereference (ehci.c)
- Abort quickly if we don't have a buffer in all the cases. (uhci.c)
- Only do the software reset if we are dying, like we do in ohci and
  ehci (uhci.c)

Submitted-by: Gary <gary@velocity-servers.net>
Taken-from: NetBSD

16 years agoFix typo.
Sascha Wildner [Fri, 28 Apr 2006 20:16:26 +0000 (20:16 +0000)]
Fix typo.

16 years agoNever generate external references for __cursig().
Sascha Wildner [Fri, 28 Apr 2006 18:23:45 +0000 (18:23 +0000)]
Never generate external references for __cursig().

For what it's worth, this fixes buildkernel with -O0.

__inline-clue-by: joerg

16 years agoMove the error check into the else clause because it only applies there.
Sascha Wildner [Fri, 28 Apr 2006 16:45:34 +0000 (16:45 +0000)]
Move the error check into the else clause because it only applies there.

16 years agoGet rid of pbgetvp() and pbrelvp(). Instead fold the B_PAGING flag directly
Matthew Dillon [Fri, 28 Apr 2006 16:34:02 +0000 (16:34 +0000)]
Get rid of pbgetvp() and pbrelvp().  Instead fold the B_PAGING flag directly
into getpbuf() (the only type of buffer that pbgetvp() could be called on
anyway).  Change related b_flags assignments from '=' to '|='.

Get rid of remaining depdendancies on b_vp.  vn_strategy() now relies solely
on the vp passed to it as an argument.  Remove buffer cache code that sets
b_vp for anonymous pbuf's.

Add a stopgap 'vp' argument to vfs_busy_pages().  This is only really needed
by NFS and the clustering code do to the severely hackish nature of the
NFS and clustering code.

Fix a bug in the ext2fs inode code where vfs_busy_pages() was being called
on B_CACHE buffers.  Add an assertion to vfs_busy_pages() to panic if it
encounters a B_CACHE buffer.

16 years agoRemove non-existant variable from debugging message.
Matthew Dillon [Fri, 28 Apr 2006 16:06:50 +0000 (16:06 +0000)]
Remove non-existant variable from debugging message.

Reported-by: Sascha Wildner <saw@online.de>
16 years agoGet rid of the remaining buffer background bitmap code. It's been turned
Matthew Dillon [Fri, 28 Apr 2006 06:13:56 +0000 (06:13 +0000)]
Get rid of the remaining buffer background bitmap code.  It's been turned
off for a while, and it represents a fairly severe hack to the buffer
cache code that just complicates further development.

16 years agoRemove the buffer cache's B_PHYS flag. This flag was originally used as
Matthew Dillon [Fri, 28 Apr 2006 00:24:46 +0000 (00:24 +0000)]
Remove the buffer cache's B_PHYS flag.  This flag was originally used as
part of a severe hack to treat buffers containing 'user' addresses
differently, in particular by using b_offset instead of b_blkno.  Now that
buffer cache buffers only HAVE b_offset (b_*blkno is gone for good), there
is literally no difference between B_PHYS I/O and non-B_PHYS I/O once
the buffer has been handed off to the device.

16 years agoFix a bug in the POSIX locking code. The system could lose track of
Matthew Dillon [Fri, 28 Apr 2006 00:13:23 +0000 (00:13 +0000)]
Fix a bug in the POSIX locking code.  The system could lose track of
range locks due to a bad flags assignment, resulting in odd operation and/or
an assertion at process exit.  Fix the flags assignment.

Reported-by: Stefan Krueger <skrueger@meinberlikomm.de>
16 years agoMove most references to the buffer cache array (buf[]) to kern/vfs_bio.c.
Matthew Dillon [Thu, 27 Apr 2006 23:28:37 +0000 (23:28 +0000)]
Move most references to the buffer cache array (buf[]) to kern/vfs_bio.c.
Implement a procedure which scans all buffers, called scan_all_buffers().
Cleanup unused debugging code referencing buf[].

16 years agoGet rid of libcr, the idea(s) behind it are not really applicable anymore
Matthew Dillon [Thu, 27 Apr 2006 17:23:14 +0000 (17:23 +0000)]
Get rid of libcr, the idea(s) behind it are not really applicable anymore
now that libc_r is properly linked against libc.

16 years agogrrr...fix reverse chronological order
Sascha Wildner [Thu, 27 Apr 2006 16:01:33 +0000 (16:01 +0000)]
grrr...fix reverse chronological order

16 years agoUpdate HISTORY section for preadv and pwritev.
Sascha Wildner [Thu, 27 Apr 2006 15:49:57 +0000 (15:49 +0000)]
Update HISTORY section for preadv and pwritev.

16 years agoAdd documentation for the new preadv(2) and pwritev(2) system calls.
Sascha Wildner [Thu, 27 Apr 2006 15:36:00 +0000 (15:36 +0000)]
Add documentation for the new preadv(2) and pwritev(2) system calls.

Submitted-by: Chuck Tuffli <ctuffli@gmail.com>
16 years agoSignals are described in signal(3).
Sascha Wildner [Thu, 27 Apr 2006 10:25:34 +0000 (10:25 +0000)]
Signals are described in signal(3).

16 years agoRemove unneeded comma.
Sascha Wildner [Thu, 27 Apr 2006 10:24:14 +0000 (10:24 +0000)]
Remove unneeded comma.

16 years agoRemove trailing whitespace.
Sascha Wildner [Thu, 27 Apr 2006 10:23:20 +0000 (10:23 +0000)]
Remove trailing whitespace.

16 years agos/pxeldr/pxeboot/
Sascha Wildner [Thu, 27 Apr 2006 10:22:08 +0000 (10:22 +0000)]

16 years agoAdd missing braces.
Sascha Wildner [Thu, 27 Apr 2006 08:19:29 +0000 (08:19 +0000)]
Add missing braces.

Submitted-by: Csaba Henk <csaba.henk@creo.hu>
16 years agoFix LINT build.
Sascha Wildner [Thu, 27 Apr 2006 08:03:56 +0000 (08:03 +0000)]
Fix LINT build.

kern_readv() and kern_writev() were renamed to kern_preadv() and

16 years agoFix the range checking for all read and write system calls. Fix the
Matthew Dillon [Wed, 26 Apr 2006 17:42:55 +0000 (17:42 +0000)]
Fix the range checking for all read and write system calls.  Fix the
iovec code to properly range-check iovec elements and to ensure that
the total length does not overflow a signed integer.  Regardless of
'size_t', the kernel does not allow any single I/O operation to exceed
2^31 bytes.

16 years agoAdd the preadv() and pwritev() systems and regenerate.
Matthew Dillon [Wed, 26 Apr 2006 17:17:57 +0000 (17:17 +0000)]
Add the preadv() and pwritev() systems and regenerate.

Submitted-by: Chuck Tuffli <ctuffli@gmail.com>
Loosely-based-on: FreeBSD

16 years agoGet rid of the weird FSMID update path in the vnode and namecache code.
Matthew Dillon [Tue, 25 Apr 2006 22:11:32 +0000 (22:11 +0000)]
Get rid of the weird FSMID update path in the vnode and namecache code.
Instead, mark the vnode as needing an FSMID update when the vnode is
disconnected from the namecache.

This fixes a bug where FSMID updates were being lost at unmount time.

16 years agoSeparate the MD5 code into its own module.
Matthew Dillon [Tue, 25 Apr 2006 21:30:45 +0000 (21:30 +0000)]
Separate the MD5 code into its own module.

Add -k/-K to have cpdup use the experimental FSMID to detect changes,
allowing it to shortcut whole directory subhiearchies.

It should be noted that using cpdup with a NFS or other remote filesystem
as the source with this option will not work, since the NFS client cannot
currently detect if the server (or some other client) has modified a file
or directory.

16 years agoGenerate unique identifiers for simulated FSMIDs so any errors appear to
Matthew Dillon [Tue, 25 Apr 2006 19:36:03 +0000 (19:36 +0000)]
Generate unique identifiers for simulated FSMIDs so any errors appear to
indicate that a modification has occured.

16 years agoRename KVM_READ() to kread() and make it a real procedure. Also incorporate
Matthew Dillon [Tue, 25 Apr 2006 16:37:44 +0000 (16:37 +0000)]
Rename KVM_READ() to kread() and make it a real procedure.  Also incorporate
some suggestions by Mark W. Krentel.

Submitted-by: (references to Mark's suggestions) Stefan Krueger
16 years agoAdd a memory wrap check to kernacc to try to reduce instances of a bogus
Matthew Dillon [Tue, 25 Apr 2006 16:22:32 +0000 (16:22 +0000)]
Add a memory wrap check to kernacc to try to reduce instances of a bogus
kmem access crashing the kernel.

Taken-from: posting by Mark W. Krentel to the FreeBSD lists
Submitted-by: Stefan Krueger <skrueger@meinberlikomm.de>
16 years agovfsync() is not in the business of removing buffers beyond the file EOF.
Matthew Dillon [Mon, 24 Apr 2006 22:01:52 +0000 (22:01 +0000)]
vfsync() is not in the business of removing buffers beyond the file EOF.
Remove the procedural argument and related code.

16 years agoCall vnode_pager_setsize() before BALLOC rather than after.
Matthew Dillon [Mon, 24 Apr 2006 21:45:47 +0000 (21:45 +0000)]
Call vnode_pager_setsize() before BALLOC rather than after.

16 years agoIf softupdates or some other entity re-dirties a buffer, make sure
Matthew Dillon [Mon, 24 Apr 2006 21:44:52 +0000 (21:44 +0000)]
If softupdates or some other entity re-dirties a buffer, make sure
that B_NOCACHE is cleared to prevent the buffer from being discarded.
Add printfs to warn if the situation is encountered.

Fix a bug in brelse() where a buffer's flags were being modified after
the unlock instead of before.

16 years agoB_INVAFTERWRITE is no longer used, remove it.
Matthew Dillon [Mon, 24 Apr 2006 19:15:47 +0000 (19:15 +0000)]
B_INVAFTERWRITE is no longer used, remove it.

16 years agoFix an incorrect header length comparison for IPSEC AH. Add required
Matthew Dillon [Sun, 23 Apr 2006 17:56:36 +0000 (17:56 +0000)]
Fix an incorrect header length comparison for IPSEC AH.  Add required
includes for two other files.

Submitted-by: Gary Allan <dragonfly@gallan.plus.com>
16 years agoThe nticks calculation is still broken. Sometimes the delta systimer
Matthew Dillon [Sun, 23 Apr 2006 17:48:59 +0000 (17:48 +0000)]
The nticks calculation is still broken.  Sometimes the delta systimer
value is less then the periodic value.  This has been tracked down to
a 32 bit overflow, but 32 bit overflows are SOP for systimers.  The
actual bug is related to lwp_slptime.  lwp_slptime is supposed to detect
that an overflow might have occured but apparently it can wind up 0 in
certain cases which have yet to be tracked down.

For now just sanitize nticks.

Reported-by: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>
16 years agoAdjust manual pages to recent lock related changes.
Sascha Wildner [Sun, 23 Apr 2006 16:23:12 +0000 (16:23 +0000)]
Adjust manual pages to recent lock related changes.

16 years agoRemove LK_REENABLE (related to the LK_DRAIN removal).
Matthew Dillon [Sun, 23 Apr 2006 06:31:47 +0000 (06:31 +0000)]
Remove LK_REENABLE (related to the LK_DRAIN removal).

16 years agoRemove the now unused interlock argument to the lockmgr() procedure.
Matthew Dillon [Sun, 23 Apr 2006 03:08:04 +0000 (03:08 +0000)]
Remove the now unused interlock argument to the lockmgr() procedure.
This argument has been abused over the years by kernel programmers
attempting to optimize certain locking and data modification sequences,
resulting in a virtually unreadable code in some cases.  The interlock
also made porting between BSDs difficult as each BSD implemented their
interlock differently.  DragonFly has slowly removed use of the interlock
argument and we can now finally be rid of it entirely.

16 years agoRemove remaining uses of the lockmgr LK_INTERLOCK flag.
Matthew Dillon [Sun, 23 Apr 2006 02:43:19 +0000 (02:43 +0000)]
Remove remaining uses of the lockmgr LK_INTERLOCK flag.

16 years agoRemove all remaining support for LK_DRAIN lockmgr locks. LK_DRAIN was a
Matthew Dillon [Sun, 23 Apr 2006 02:41:15 +0000 (02:41 +0000)]
Remove all remaining support for LK_DRAIN lockmgr locks.  LK_DRAIN was a
mechanism that allowed lock requests to fail while a thread is blocked
disposing of a structure that has not been entirely unlinked from the
rest of the system, but LK_DRAIN's design only works on UP systems or
while the BGL is held.  It cannot be used in concurrent environments.
Just get rid of it entirely.

16 years agoGet rid of LK_DRAIN, rely on nc_lwant to interlock lock races against
Matthew Dillon [Sun, 23 Apr 2006 02:33:23 +0000 (02:33 +0000)]
Get rid of LK_DRAIN, rely on nc_lwant to interlock lock races against
termination.  Only unlock/relock in ncp_conn_free() if lwant is non-zero.

It is unclear whether nc_lwant is sufficient, though, but the original
code was pretty horrendous.

16 years agoGet rid of LK_DRAIN and LK_INTERLOCK interactions. Recode interlocks when
Matthew Dillon [Sun, 23 Apr 2006 02:29:33 +0000 (02:29 +0000)]
Get rid of LK_DRAIN and LK_INTERLOCK interactions.  Recode interlocks when
handling node termination (smb_co_gone) and fix a couple of race conditions
while we are in here that we used to rely on LK_DRAIN to handle.

16 years agoRun the lockmgr() call independant of the KASSERT() in smb_co_init().
Matthew Dillon [Sun, 23 Apr 2006 01:17:25 +0000 (01:17 +0000)]
Run the lockmgr() call independant of the KASSERT() in smb_co_init().

16 years agoLK_DRAIN locks are no longer obtained on vnodes, rip out the check.
Matthew Dillon [Sun, 23 Apr 2006 00:54:57 +0000 (00:54 +0000)]
LK_DRAIN locks are no longer obtained on vnodes, rip out the check.

16 years agoGet rid of LK_DRAIN in dounmount(). LK_DRAIN locks are not SMP friendly and
Matthew Dillon [Sun, 23 Apr 2006 00:54:11 +0000 (00:54 +0000)]
Get rid of LK_DRAIN in dounmount().  LK_DRAIN locks are not SMP friendly and
can lead to structural pointer races against free() operations.  Struct mount
is protected by the MNTK_UNMOUNT flag.

16 years agoRemove unused code label.
Matthew Dillon [Sun, 23 Apr 2006 00:47:10 +0000 (00:47 +0000)]
Remove unused code label.

16 years agoGet rid of LK_PCATCH in the agp lockmgr() calls. AGP ignores the return
Matthew Dillon [Sat, 22 Apr 2006 23:41:43 +0000 (23:41 +0000)]
Get rid of LK_PCATCH in the agp lockmgr() calls.  AGP ignores the return
value and a caught event would only result in a panic.

Get rid of LK_DRAIN in the device detach code.  The device had better not
be in operation during a detach!

Add missing lockmgr LK_RELEASE calls in a number of early-return cases.

16 years agoGet rid of unused arg.
Matthew Dillon [Sat, 22 Apr 2006 22:34:06 +0000 (22:34 +0000)]
Get rid of unused arg.

16 years agoMisc sysperf cleanups. Add another mutex tester to test the xchgl
Matthew Dillon [Sat, 22 Apr 2006 22:32:52 +0000 (22:32 +0000)]
Misc sysperf cleanups.  Add another mutex tester to test the xchgl

16 years agoAdd spin_uninit() to provide symmetry with spin_init().
Matthew Dillon [Sat, 22 Apr 2006 22:19:19 +0000 (22:19 +0000)]
Add spin_uninit() to provide symmetry with spin_init().

16 years agoMinor typing cleanups for aicasm.
Matthew Dillon [Sat, 22 Apr 2006 16:15:26 +0000 (16:15 +0000)]
Minor typing cleanups for aicasm.

Submitted-by: Xin LI <delphij@delphij.net>
16 years agoZero out stack memory before copying out to requesting process.
Jeffrey Hsu [Fri, 21 Apr 2006 19:43:58 +0000 (19:43 +0000)]
Zero out stack memory before copying out to requesting process.
NetBSD Security Advisory 2006-005:  minor stack information leak.
Same as NetBSD revs 1.35 and 1.36.  Originally reported by Xin Li.

16 years agom_free -> m_freem
Sepherosa Ziehau [Fri, 21 Apr 2006 13:01:34 +0000 (13:01 +0000)]
m_free -> m_freem

16 years agoIntroduce a new variable to hold the size of buf.
Joerg Sonnenberger [Tue, 18 Apr 2006 22:11:35 +0000 (22:11 +0000)]
Introduce a new variable to hold the size of buf.

16 years agoAdd missing cm(4), mn(4) and my(4) manual pages.
Sascha Wildner [Mon, 17 Apr 2006 21:32:57 +0000 (21:32 +0000)]
Add missing cm(4), mn(4) and my(4) manual pages.

Taken-from: FreeBSD

16 years agoSync with FreeBSD's rev. 1.7.
Sascha Wildner [Mon, 17 Apr 2006 20:13:57 +0000 (20:13 +0000)]
Sync with FreeBSD's rev. 1.7.

16 years agoAssorted .Xr fixes:
Sascha Wildner [Mon, 17 Apr 2006 18:01:38 +0000 (18:01 +0000)]
Assorted .Xr fixes:

* Add section numbers and fix wrong ones.

* Use .Em, .Nm and .Pa instead of .Xr where appropriate.

* Fix obsolete references.

* Fix typos.

16 years agoWe use RCNG for restarting.
Sascha Wildner [Mon, 17 Apr 2006 17:52:17 +0000 (17:52 +0000)]
We use RCNG for restarting.

16 years agos/ndc/rndc/
Sascha Wildner [Mon, 17 Apr 2006 17:51:37 +0000 (17:51 +0000)]

16 years agoChange some documentation mentioning ports to pkgsrc.
Sascha Wildner [Mon, 17 Apr 2006 17:40:34 +0000 (17:40 +0000)]
Change some documentation mentioning ports to pkgsrc.

16 years agoRemove sysinstall(8) reference and fix wording.
Sascha Wildner [Mon, 17 Apr 2006 17:34:21 +0000 (17:34 +0000)]
Remove sysinstall(8) reference and fix wording.

16 years agoBring in some small changes from FreeBSD.
Matthew Dillon [Mon, 17 Apr 2006 15:59:55 +0000 (15:59 +0000)]
Bring in some small changes from FreeBSD.

-  Close a very small race with command hand-off.  Add an extra diagnostic
   to the timeout code.
- Fix a potential adapter deadlock/panic.
- Add support for a few cards

Submitted-by: Gary <gary@velocity-servers.net>
Taken-from: FreeBSD

16 years agoAdd MLINK for rc.d(8).
Sascha Wildner [Sat, 15 Apr 2006 07:44:48 +0000 (07:44 +0000)]
Add MLINK for rc.d(8).

16 years agoGenerate a host-unreachable failure rather then a crash if the MTU is too
Matthew Dillon [Fri, 14 Apr 2006 21:18:24 +0000 (21:18 +0000)]
Generate a host-unreachable failure rather then a crash if the MTU is too
small to support the required TCP/IP/IPSEC options.

Reported-by: Johannes Hofmann <Johannes.Hofmann@gmx.de>
16 years agoRecent bug fixes make this worthy for testing, update to 1.5.3 and slip the
Matthew Dillon [Fri, 14 Apr 2006 21:06:35 +0000 (21:06 +0000)]
Recent bug fixes make this worthy for testing, update to 1.5.3 and slip the
Preview tag.

16 years agoFix a bug in the pkg_add -n tests where pkg_add was incorrectly reporting
Matthew Dillon [Fri, 14 Apr 2006 20:56:53 +0000 (20:56 +0000)]
Fix a bug in the pkg_add -n tests where pkg_add was incorrectly reporting
conflicts with the machine's currently installed package set.

Update the installer to fix a segfault-on-install bug due to the code
incorrectly assuming that dirname() returned malloc()'d memory that the
caller must free.

The installed /etc will have a proper aliases.db (sendmail) file, fixing
a syslog warning from sendmail.

16 years agoConditionalize a lwkt_send_ipiq2() to fix the UP build.
Matthew Dillon [Fri, 14 Apr 2006 20:08:34 +0000 (20:08 +0000)]
Conditionalize a lwkt_send_ipiq2() to fix the UP build.

16 years agoAlways guarentee at least one space between two network addresses.
Matthew Dillon [Fri, 14 Apr 2006 16:48:27 +0000 (16:48 +0000)]
Always guarentee at least one space between two network addresses.
Otherwise IPV6 addresses will abut each other.

Submitted-by: Francis Gudin <fgudin@nerim.net>
16 years ago* Comment out reference to non-existing format command.
Sascha Wildner [Fri, 14 Apr 2006 05:45:15 +0000 (05:45 +0000)]
* Comment out reference to non-existing format command.

* Fix wording.

Taken-from: FreeBSD

16 years agoFix an edge case where objects can be returned to a per-cpu cache while
Matthew Dillon [Fri, 14 Apr 2006 02:58:49 +0000 (02:58 +0000)]
Fix an edge case where objects can be returned to a per-cpu cache while
the objcache is blocked on the depot token.  the depot is found to be
exhausted and objcache blocks anyway.  Rechecking the per-cpu cache after
obtaining the token deals with the problem.

Normally this isn't a problem but on low-memory machines the objcache
is tight enough on memory that the returned objects could represent all
returnable objects at that time and a tsleep without checking for their
presence would block the calling thread forever.

Reported-by: Stefan Krueger <skrueger@meinberlikomm.de>
Also-thanks-to: Peter Holms filesystem and load testing suite (stress2).

16 years agovop_stdopen() must be called when a fifo_open fails in order to then be
Matthew Dillon [Fri, 14 Apr 2006 01:07:38 +0000 (01:07 +0000)]
vop_stdopen() must be called when a fifo_open fails in order to then be
able to call VOP_CLOSE().  Otherwise the opencount or writecount gets out
of synch and causes a panic.

Reported-by: "David Rhodus" <drhodus@machdep.com>
16 years agoFix a livelock in the objcache blocking code. PCATCH was being improperly
Matthew Dillon [Fri, 14 Apr 2006 01:06:21 +0000 (01:06 +0000)]
Fix a livelock in the objcache blocking code.  PCATCH was being improperly
passed to tsleep.

Fix harmless but inefficient wakeups in the objcache code.  When a thread
blocks on the objcache it tsleep's on the depot.  When objects are returned
to the objcache a wakeup is performed on the depot.  However, objects can
be returned to the depot OR returned to the current cpu's cache.  When an
object is returned to the current cpu's cache, only wakeup threads blocked
on the depot originating from the current cpu, rather then all cpus.

Reported-by: Stefan Krueger <skrueger@meinberlikomm.de>
Also-thanks-to: Peter Holms filesystem and load testing suite (stress2).

16 years agoSupply version of wakeup() which only operate on threads blocked on the
Matthew Dillon [Fri, 14 Apr 2006 01:00:16 +0000 (01:00 +0000)]
Supply version of wakeup() which only operate on threads blocked on the
same cpu, or on a particular cpu.

16 years agoIf a process forks while being scanned, a non-zero p_lock will be inherited
Matthew Dillon [Fri, 14 Apr 2006 00:59:05 +0000 (00:59 +0000)]
If a process forks while being scanned, a non-zero p_lock will be inherited
by the child process preventing it from being able to exit.  Make sure that
p_lock is zero'd on fork.

Reported-by: Stefan Krueger <skrueger@meinberlikomm.de>
Also-thanks-to: Peter Holms filesystem and load testing suite (stress2).

16 years agoNTFS sometimes splits the initialization of a new vnode into two parts.
Matthew Dillon [Thu, 13 Apr 2006 19:25:09 +0000 (19:25 +0000)]
NTFS sometimes splits the initialization of a new vnode into two parts.
Make sure VMIO is enabled for regular files so BUF/BIO ops work in the
second part as VREG might not be set in the first part.

Reported-by: Stefan Krueger <skrueger@meinberlikomm.de>
16 years agoAdd gbk.5 to the Makefile (forgotten when it was moved here).
Sascha Wildner [Thu, 13 Apr 2006 18:41:05 +0000 (18:41 +0000)]
Add gbk.5 to the Makefile (forgotten when it was moved here).

16 years agoSeperate _mutex_cv_unlock from _mutex_unlock_common.
David Xu [Thu, 13 Apr 2006 11:53:39 +0000 (11:53 +0000)]
Seperate _mutex_cv_unlock from _mutex_unlock_common.

16 years agonamespace cleanup.
David Xu [Thu, 13 Apr 2006 11:48:35 +0000 (11:48 +0000)]
namespace cleanup.

16 years ago1) Use int for m_flags of pthread_mutexattr.
David Xu [Thu, 13 Apr 2006 11:48:01 +0000 (11:48 +0000)]
1) Use int for m_flags of pthread_mutexattr.
2) Move up COND_FLAGS.
3) Remove some unused flags.
4) Remove unused arg_attr of pthread_cleanup.
5) Remove unused pthread_wait_data.

16 years agoFor symmetry's sake, put as(1) into the amd64 Makefile, too.
Sascha Wildner [Wed, 12 Apr 2006 19:39:55 +0000 (19:39 +0000)]
For symmetry's sake, put as(1) into the amd64 Makefile, too.

16 years agoMerge from vendor branch BINUTILS:
Sascha Wildner [Wed, 12 Apr 2006 19:21:23 +0000 (19:21 +0000)]
Merge from vendor branch BINUTILS:
Add as(1) manual page.

16 years agoAdd as(1) manual page.
Sascha Wildner [Wed, 12 Apr 2006 19:21:23 +0000 (19:21 +0000)]
Add as(1) manual page.

16 years agoAdd as(1) manual page.
Sascha Wildner [Wed, 12 Apr 2006 19:21:23 +0000 (19:21 +0000)]
Add as(1) manual page.

16 years agoNote: the previous rev's CVS comment was messed up due to an editor snafu.
Matthew Dillon [Wed, 12 Apr 2006 18:28:30 +0000 (18:28 +0000)]
Note: the previous rev's CVS comment was messed up due to an editor snafu.

/dev/random was almost always returning 0 bytes.  This was due to several
factors, primarily the fact that the stack smash handler reads 32 bytes from
/dev/urandom every time a program is exec'd, and because /dev/random and
/dev/urandom share the same pool.

* Give /dev/random and /dev/urandom their own separate pools.

* Be slightly less conservative on the number of bits of randomness we
  think we've added.

* extract_entropy() calls add_timer_randomness(), which adds entropy.  This
  can create a situation where entropy always appears to be available when,
  in fact, it is of very low quality.  Add a little hysteresis so degenerate
  cases return 0 bytes instead of 1 byte.

* Also (in this commit) fix a bug in the previous commit where the randomness
  added was accidently halved.

Reported-by: David Rhodus
16 years ago/dev/random was almost always returning 0 bytes. This was due to several
Matthew Dillon [Wed, 12 Apr 2006 18:20:54 +0000 (18:20 +0000)]
/dev/random was almost always returning 0 bytes.  This was due to several
factors, primarily the fact that the stack smash handler reads 32 bytes from
/dev/urandom every time a program is exec'd, and because /dev/random and
/dev/urandom share the same pool.

involved:  (1) The stack smash handler reads 32 bytes from /dev/urandom every
time a program is exec'd.  This exhausts the pool almost immediately.
(2) /dev/random and /dev/urandom share the same pool, and /dev/urandom is
called so often that there is never any entropy available for /dev/random.

Give /dev/random and /dev/urandom separate entropy pools and make the entropy
loss calculation less conservative.

Reported-by: David Rhodus
16 years agolinux(4) was added in Sep 2003 but never made it into the Makefile.
Sascha Wildner [Wed, 12 Apr 2006 13:10:16 +0000 (13:10 +0000)]
linux(4) was added in Sep 2003 but never made it into the Makefile.

16 years agoMerge bug fix from binutils main line:
Joerg Sonnenberger [Tue, 11 Apr 2006 12:14:01 +0000 (12:14 +0000)]
Merge bug fix from binutils main line:
When a thread local symbol is accessed both from PIC and
non-PIC code, ld incorrectly merged both entries in the main
program, ignoring the different relocation offsets. This occured
originally in dbus-0.61 and showed itself in segfaults within rtld.

MFC after 3 days