]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 years agoImprove multilink receive performance by netgraph item reuse.
Alexander Motin [Sat, 26 Jan 2008 22:42:47 +0000 (22:42 +0000)]
Improve multilink receive performance by netgraph item reuse.

16 years agoImprove multilink xmit performance by netgraph item reuse.
Alexander Motin [Sat, 26 Jan 2008 22:41:14 +0000 (22:41 +0000)]
Improve multilink xmit performance by netgraph item reuse.

16 years agoImprove multilink receive performance with fragment headers preallocation.
Alexander Motin [Sat, 26 Jan 2008 22:39:05 +0000 (22:39 +0000)]
Improve multilink receive performance with fragment headers preallocation.

16 years agorx mbufs must have a pkthdr; use m_gethdr to populate the rx ring
Sam Leffler [Sat, 26 Jan 2008 22:35:57 +0000 (22:35 +0000)]
rx mbufs must have a pkthdr; use m_gethdr to populate the rx ring
(and while here correct the mbuf type)

Submitted by: Sam Banks <w0lfie@clear.net.nz>
MFC after: 1 week

16 years agoAllow DDB_CAPTURE_DEFAULTBUFSIZE and DDB_CAPTURE_MAXBUFSIZE to be
Robert Watson [Sat, 26 Jan 2008 22:32:23 +0000 (22:32 +0000)]
Allow DDB_CAPTURE_DEFAULTBUFSIZE and DDB_CAPTURE_MAXBUFSIZE to be
overridden at compile-time using kernel options of the same names.

Rather than doing a compile-time CTASSERT of buffer sizes being
even multiples of block sizes, just adjust them at boottime, as
the failure mode is more user-friendly.

MFC after: 2 months
PR: 119993
Suggested by: Scot Hetzel <swhetzel at gmail dot com>

16 years agoOLDCARD is gone, release imp's lock.
Christian Brueffer [Sat, 26 Jan 2008 21:58:52 +0000 (21:58 +0000)]
OLDCARD is gone, release imp's lock.

Approved by: imp

16 years agoOLDCARD is long gone, so finally remove the oldcard.4 manpage.
Christian Brueffer [Sat, 26 Jan 2008 20:23:25 +0000 (20:23 +0000)]
OLDCARD is long gone, so finally remove the oldcard.4 manpage.

Confirmed by: imp

16 years agoOur fts(3) API, as inherited from 4.4BSD, suffers from integer
Yaroslav Tykhiy [Sat, 26 Jan 2008 17:09:40 +0000 (17:09 +0000)]
Our fts(3) API, as inherited from 4.4BSD, suffers from integer
fields in FTS and FTSENT structs being too narrow.  In addition,
the narrow types creep from there into fts.c.  As a result, fts(3)
consumers, e.g., find(1) or rm(1), can't handle file trees an ordinary
user can create, which can have security implications.

To fix the historic implementation of fts(3), OpenBSD and NetBSD
have already changed <fts.h> in somewhat incompatible ways, so we
are free to do so, too.  This change is a superset of changes from
the other BSDs with a few more improvements.  It doesn't touch
fts(3) functionality; it just extends integer types used by it to
match modern reality and the C standard.

Here are its points:

o For C object sizes, use size_t unless it's 100% certain that
  the object will be really small.  (Note that fts(3) can construct
  pathnames _much_ longer than PATH_MAX for its consumers.)

o Avoid the short types because on modern platforms using them
  results in larger and slower code.  Change shorts to ints as
  follows:

- For variables than count simple, limited things like states,
  use plain vanilla `int' as it's the type of choice in C.

- For a limited number of bit flags use `unsigned' because signed
  bit-wise operations are implementation-defined, i.e., unportable,
  in C.

o For things that should be at least 64 bits wide, use long long
  and not int64_t, as the latter is an optional type.  See
  FTSENT.fts_number aka FTS.fts_bignum.  Extending fts_number `to
  satisfy future needs' is pointless because there is fts_pointer,
  which can be used to link to arbitrary data from an FTSENT.
  However, there already are fts(3) consumers that require fts_number,
  or fts_bignum, have at least 64 bits in it, so we must allow for them.

o For the tree depth, use `long'.  This is a trade-off between making
  this field too wide and allowing for 64-bit inode numbers and/or
  chain-mounted filesystems.  On the one hand, `long' is almost
  enough for 32-bit filesystems on a 32-bit platform (our ino_t is
  uint32_t now).  On the other hand, platforms with a 64-bit (or
  wider) `long' will be ready for 64-bit inode numbers, as well as
  for several 32-bit filesystems mounted one under another.  Note
  that fts_level has to be signed because -1 is a magic value for it,
  FTS_ROOTPARENTLEVEL.

o For the `nlinks' local var in fts_build(), use `long'.  The logic
  in fts_build() requires that `nlinks' be signed, but our nlink_t
  currently is uint16_t.  Therefore let's make the signed var wide
  enough to be able to represent 2^16-1 in pure C99, and even 2^32-1
  on a 64-bit platform.  Perhaps the logic should be changed just
  to use nlink_t, but it can be done later w/o breaking fts(3) ABI
  any more because `nlinks' is just a local var.

This commit also inludes supporting stuff for the fts change:

o Preserve the old versions of fts(3) functions through libc symbol
versioning because the old versions appeared in all our former releases.

o Bump __FreeBSD_version just in case.  There is a small chance that
some ill-written 3-rd party apps may fail to build or work correctly
if compiled after this change.

o Update the fts(3) manpage accordingly.  In particular, remove
references to fts_bignum, which was a FreeBSD-specific hack to work
around the too narrow types of FTSENT members.  Now fts_number is
at least 64 bits wide (long long) and fts_bignum is an undocumented
alias for fts_number kept around for compatibility reasons.  According
to Google Code Search, the only big consumers of fts_bignum are in
our own source tree, so they can be fixed easily to use fts_number.

o Mention the change in src/UPDATING.

PR: bin/104458
Approved by: re (quite a while ago)
Discussed with: deischen (the symbol versioning part)
Reviewed by: -arch (mostly silence); das (generally OK, but we didn't
agree on some types used; assuming that no objections on
-arch let me to stick to my opinion)

16 years agoGenerally, anything that runs rc.d scripts internally should
Mike Makonnen [Sat, 26 Jan 2008 14:02:19 +0000 (14:02 +0000)]
Generally, anything that runs rc.d scripts internally should
start using the quiet prefix (i.e. quietstart, quietstop, etc...).

16 years agoRename DB_ constants in db_capture.c to DDB_ so that when they are
Robert Watson [Sat, 26 Jan 2008 13:55:52 +0000 (13:55 +0000)]
Rename DB_ constants in db_capture.c to DDB_ so that when they are
exposed as kernel compile options, they have more meaningful names.

PR: 119993
MFC after: 2 months
Suggested by: Scot Hetzel <swhetzel at gmail dot com>

16 years agoGenerally, anything that runs rc.d scripts internally should
Mike Makonnen [Sat, 26 Jan 2008 13:50:38 +0000 (13:50 +0000)]
Generally, anything that runs rc.d scripts internally should
start using the quiet prefix (i.e. quietstart, quietstop, etc...).

16 years agoUse 'quietstart' so as not to get spammed with informational diagnostics.
Mike Makonnen [Sat, 26 Jan 2008 13:37:48 +0000 (13:37 +0000)]
Use 'quietstart' so as not to get spammed with informational diagnostics.

16 years agoExplain how the passno field in /etc/fstab works with fsck
Mike Pritchard [Sat, 26 Jan 2008 13:03:35 +0000 (13:03 +0000)]
Explain how the passno field in /etc/fstab works with fsck
and quotacheck in some more detail.

16 years agoDocument the no-op -r option of BSD xargs(1).
Giorgos Keramidas [Sat, 26 Jan 2008 12:38:19 +0000 (12:38 +0000)]
Document the no-op -r option of BSD xargs(1).

PR: docs/106416
Submitted by: Pete Slagle, freebsd-stable at voidcaptain.com
MFC after: 3 days

16 years agoRemove Giant acquisition around soreceive() and sosend() in fifofs. The
Robert Watson [Sat, 26 Jan 2008 12:34:23 +0000 (12:34 +0000)]
Remove Giant acquisition around soreceive() and sosend() in fifofs.  The
bug that caused us to reintroduce it is believed to be fixed, and Kris
says he no longer sees problems with fifofs in highly parallel builds.
If this works out, we'll MFC it for 7.1.

MFC after: 3 months
Pointed out by: kris

16 years agoSync up quotacheck's preen.c with fsck's. This makes quotacheck
Mike Pritchard [Sat, 26 Jan 2008 12:03:26 +0000 (12:03 +0000)]
Sync up quotacheck's preen.c with fsck's.  This makes quotacheck
process parallel checks in the same way as fsck, since fsck supports
pass numbers other than 0, 1 or 2.  Without this, quotacheck would
ignore file systems with pass numbers > 2.

The -l (maxrun) option is now deprecated and can be tuned with pass
numbers in /etc/fstab if needed.

16 years agoRe-implement: do not silently fail when a command is not carried
Mike Makonnen [Sat, 26 Jan 2008 11:22:12 +0000 (11:22 +0000)]
Re-implement: do not silently fail when a command is not carried
out because the rc.conf(5) variable was not enabled. Display a
message that the command wasn't run and offer suggestions on
what the user can do.

Implement a quiet prefix, which will disable some diagnostics. The
fast prefix also implies quiet. During boot we use either fast or
quiet. For shutdown we already use 'faststop'. So, this informational
message should only appear during interactive use.

An additional benefit of having a quiet prefix is that we can start
putting some of our diagnostic messages behind this knob and start
"de-cluttering" the console during boot and shutdown.

16 years agoCatch up with revision 1.18 of dcons_os.c and add an example of how to use
Tom Rhodes [Sat, 26 Jan 2008 06:50:14 +0000 (06:50 +0000)]
Catch up with revision 1.18 of dcons_os.c and add an example of how to use
dcons(4) as a valid gdb port.

PR:             118490
Submitted by:   Alexandre Kovalenko <alex.kovalenko@verizon.net>

16 years agoIn rev. 1.156, the convertion of the minor number to the unit number
Konstantin Belousov [Sat, 26 Jan 2008 06:09:23 +0000 (06:09 +0000)]
In rev. 1.156, the convertion of the minor number to the unit number
resulted in the argument to the make_dev() to be a unit number.

Correct this by supplying a minor number to make_dev(), and using
the unit number for the calculation of the slave tty name.

Reported and tested by: Peter Holm
Reviewed by: jhb
Yet another pointy hat to: kib
MFC after: 1 day

16 years agoOne of my powerbooks has this chip in it..
Julian Elischer [Sat, 26 Jan 2008 05:11:09 +0000 (05:11 +0000)]
One of my powerbooks has this chip in it..
Confirmed by looking at netbsd.. they have also added this.
checked by grehen
MFC After: 3 days

16 years agoAllow arbitrary baud rates, not just the standard ones.
Ed Maste [Sat, 26 Jan 2008 04:30:48 +0000 (04:30 +0000)]
Allow arbitrary baud rates, not just the standard ones.

16 years agoadd opt_global.h dependency
Kip Macy [Sat, 26 Jan 2008 01:00:56 +0000 (01:00 +0000)]
add opt_global.h dependency

16 years agoFix a harmless type error in 1.9.
Bruce Evans [Fri, 25 Jan 2008 21:09:21 +0000 (21:09 +0000)]
Fix a harmless type error in 1.9.

16 years agoFix a bug where a thread that hit the race where the sleep timeout fires
John Baldwin [Fri, 25 Jan 2008 19:44:46 +0000 (19:44 +0000)]
Fix a bug where a thread that hit the race where the sleep timeout fires
while the thread does not hold the thread lock would stop blocking for
subsequent interruptible sleeps and would always immediately fail the
sleep with EWOULDBLOCK instead (even sleeps that didn't have a timeout).

Some background:
- KSE has a facility for allowing one thread to interrupt another thread.
  During this process, the target thread aborts any interruptible sleeps
  much as if the target thread had a pending signal.  Once the target
  thread acknowledges the interrupt, normal sleep handling resumes.  KSE
  manages this via the TDF_INTERRUPTED flag.  Specifically, it sets the
  flag when it sends an interrupt to another thread and clears it when
  the interrupt is acknowledged.  (Note that this is purely a software
  interrupt sort of thing and has no relation to hardware interrupts
  or kernel interrupt threads.)
- The old code for handling the sleep timeout race handled the race
  by setting the TDF_INTERRUPT flag and faking a KSE-style thread
  interrupt to the thread in the process of going to sleep.  It probably
  should have just checked the TDF_TIMEOUT flag in sleepq_catch_signals()
  instead.
- The bug was that the sleepq code would set TDF_INTERRUPT but it was
  never cleared.  The sleepq code couldn't safely clear it in case there
  actually was a real KSE thread interrupt pending for the target thread
  (in fact, the sleepq timeout actually stomped on said pending interrupt).
  Thus, any future interruptible sleeps (*sleep(.. PCATCH ..) or
  cv_*wait_sig()) would see the TDF_INTERRUPT flag set and immediately
  fail with EWOULDBLOCK.  The flag could be cleared if the thread belonged
  to a KSE process and another thread posted an interrupt to the original
  thread.  However, in the more common case of a non-KSE process, the
  thread would pretty much stop sleeping.
- Fix the bug by just setting TDF_TIMEOUT in the sleepq timeout code and
  not messing with TDF_INTERRUPT and td_intrval.  With yesterday's fix to
  fix sleepq_switch() to check TDF_TIMEOUT, this is now sufficient.

MFC after: 3 days

16 years agoUpdate the timestamp regexps in syncstamp() and monostamp() for > 99999
John Baldwin [Fri, 25 Jan 2008 19:24:12 +0000 (19:24 +0000)]
Update the timestamp regexps in syncstamp() and monostamp() for > 99999
traces where there isn't any leading whitespace before the record number
in the ktrdump output.

16 years agoBackout previous commit. It's going to clutter the console
Mike Makonnen [Fri, 25 Jan 2008 16:44:34 +0000 (16:44 +0000)]
Backout previous commit. It's going to clutter the console
during boot and shutdown. I think I'll hide it behind autoboot or
maybe take brooks@ suggestion and implement a different command
prefix for booting/shutdown purposes, but in any case it needs more
thought and attention.

Noticed by: ceri
Pointyhat to: mtm

16 years agoClarify in what formats the grouplist for the '-G' switch may be accepted.
Mike Makonnen [Fri, 25 Jan 2008 15:54:14 +0000 (15:54 +0000)]
Clarify in what formats the grouplist for the '-G' switch may be accepted.

Submitted by: Eygene Ryabinkin <rea-fbsd@codelabs.ru>

16 years agoIf the rc.conf(5) variable for a script is not enabled do not fail
Mike Makonnen [Fri, 25 Jan 2008 15:06:26 +0000 (15:06 +0000)]
If the rc.conf(5) variable for a script is not enabled do not fail
silently. Display a message that the command wasn't run and make
possible suggestions for what to do.

PR:    conf/118770
MFC after: 1 week

16 years agoHide ipfw internal data structures behind IPFW_INTERNAL rather than
Robert Watson [Fri, 25 Jan 2008 14:38:27 +0000 (14:38 +0000)]
Hide ipfw internal data structures behind IPFW_INTERNAL rather than
exposing them to all consumers of ip_fw.h.  These structures are
used in both ipfw(8) and ipfw(4), but not part of the user<->kernel
interface for other applications to use, rather, shared
implementation.

MFC after: 3 days
Reported by: Paul Vixie <paul at vix dot com>

16 years agoRev. 1.6 made it impossible to use rc.d/kerberos with the krb5 port.
Mike Makonnen [Fri, 25 Jan 2008 05:23:01 +0000 (05:23 +0000)]
Rev. 1.6 made it impossible to use rc.d/kerberos with the krb5 port.
Re-implement the change so that the script once again works with
the krb5 port.

Submitted by: kensmith (slightly modified)
MFC after: 3 days

16 years agoCalculate baud rate divisor instead of allowing only a fixed set of
Ed Maste [Fri, 25 Jan 2008 02:41:44 +0000 (02:41 +0000)]
Calculate baud rate divisor instead of allowing only a fixed set of
standard rates.

Obtained from OpenBSD
  src/sys/dev/usb/uftdi.c 1.29
  src/sys/dev/usb/uftdireg.h 1.11

OpenBSD revisions noted by: ticso, on hackers

16 years agoFix a race in the sleepqueue timeout code that resulted in sleeps not
John Baldwin [Fri, 25 Jan 2008 02:09:38 +0000 (02:09 +0000)]
Fix a race in the sleepqueue timeout code that resulted in sleeps not
being properly cancelled by a timeout.  In general there is a race
between a the sleepq timeout handler firing while the thread is still
in the process of going to sleep.  In 6.x with sched_lock, the race was
largely protected by sched_lock.  The only place it was "exposed" and had
to be handled was while checking for any pending signals in
sleepq_catch_signals().

With the thread lock changes, the thread lock is dropped in between
sleepq_add() and sleepq_*wait*() opening up a new window for this race.
Thus, if the timeout fired while the sleeping thread was in between
sleepq_add() and sleepq_*wait*(), the thread would be marked as timed
out, but the thread would not be dequeued and sleepq_switch() would
still block the thread until it was awakened via some other means.  In
the case of pause(9) where there is no other wakeup, the thread would
never be awakened.

Fix this by teaching sleepq_switch() to check if the thread has had its
sleep canceled before blocking by checking the TDF_TIMEOUT flag and
aborting the sleep and dequeueing the thread if it is set.

MFC after: 3 days
Reported by: dwhite, peter

16 years agoOnce the release goes out, RELENG_7_* will need approval from so@.
Colin Percival [Thu, 24 Jan 2008 22:07:03 +0000 (22:07 +0000)]
Once the release goes out, RELENG_7_* will need approval from so@.

Approved by: core (two months ago)

16 years agoMove the code for working with kld's out into its own file.
John Baldwin [Thu, 24 Jan 2008 19:11:13 +0000 (19:11 +0000)]
Move the code for working with kld's out into its own file.

16 years agoWhen asked to use kqueue, AIO stores its internal state in the
Jean-Sébastien Pédron [Thu, 24 Jan 2008 17:10:19 +0000 (17:10 +0000)]
When asked to use kqueue, AIO stores its internal state in the
`kn_sdata' member of the newly registered knote. The problem is that
this member is overwritten by a call to kevent(2) with the EV_ADD flag,
targetted at the same kevent/knote. For instance, a userland application
may set the pointer to NULL, leading to a panic.

A testcase was provided by the submitter.

PR: kern/118911
Submitted by: MOROHOSHI Akihiko <moro@remus.dti.ne.jp>
MFC after: 1 day

16 years agoDo not dereference NULL scp in the case the screen is not opened.
Konstantin Belousov [Thu, 24 Jan 2008 15:37:48 +0000 (15:37 +0000)]
Do not dereference NULL scp in the case the screen is not opened.
Instead, return ENXIO to the ioctl caller.

Reported and tested by: Pawel Worach <pawel.worach gmail com>
Discussed with: markus
MFC after: 3 days

16 years agoReflect lockcount() axing and lockmgr() prototype changing.
Attilio Rao [Thu, 24 Jan 2008 14:17:52 +0000 (14:17 +0000)]
Reflect lockcount() axing and lockmgr() prototype changing.

16 years ago- sched_4bsd is no longer a default system scheduler on some
Ruslan Ermilov [Thu, 24 Jan 2008 13:48:20 +0000 (13:48 +0000)]
- sched_4bsd is no longer a default system scheduler on some
  architectures, so call it "traditional" instead.

- sched_ule is no longer buggy or experimental (according to
  rev. 1.7 of sched_ule(4)), so don't call it experimental
  (reported by a user on stable@).

Reviewed by: rwatson

16 years agoBump __FreeBSD_version in order to signal:
Attilio Rao [Thu, 24 Jan 2008 12:37:54 +0000 (12:37 +0000)]
Bump __FreeBSD_version in order to signal:
- lockmgr() prototype changing
- lockcount() axing
- LOCKMGR_ASSERT() axing

16 years agoCleanup lockmgr interface and exported KPI:
Attilio Rao [Thu, 24 Jan 2008 12:34:30 +0000 (12:34 +0000)]
Cleanup lockmgr interface and exported KPI:
- Remove the "thread" argument from the lockmgr() function as it is
  always curthread now
- Axe lockcount() function as it is no longer used
- Axe LOCKMGR_ASSERT() as it is bogus really and no currently used.
  Hopefully this will be soonly replaced by something suitable for it.
- Remove the prototype for dumplockinfo() as the function is no longer
  present

Addictionally:
- Introduce a KASSERT() in lockstatus() in order to let it accept only
  curthread or NULL as they should only be passed
- Do a little bit of style(9) cleanup on lockmgr.h

KPI results heavilly broken by this change, so manpages and
FreeBSD_version will be modified accordingly by further commits.

Tested by: matteo

16 years agoThere is no PUC_FASTINTR option anymore.
Dmitry Morozovsky [Thu, 24 Jan 2008 12:09:59 +0000 (12:09 +0000)]
There is no PUC_FASTINTR option anymore.

MFC after: 2 weeks

16 years ago- Reduce how much ZFS caches by default. This is another change to mitigate
Pawel Jakub Dawidek [Thu, 24 Jan 2008 11:24:16 +0000 (11:24 +0000)]
- Reduce how much ZFS caches by default. This is another change to mitigate
  'kmem_map too small panics'.
- Print two warnings if there is not enough memory and not enough address
  space.
- Improve comment.

16 years agoChange type of kmem_used() and kmem_size() functions to uint64_t, so it
Pawel Jakub Dawidek [Thu, 24 Jan 2008 11:21:54 +0000 (11:21 +0000)]
Change type of kmem_used() and kmem_size() functions to uint64_t, so it
doesn't overflow in arc.c in this check:

if (kmem_used() > (kmem_size() * 4) / 5)
return (1);

With this bug ZFS almost doesn't cache.

Only 32bit machines are affected that have vm.kmem_size set to values >=1GB.

Reported by: David Taylor <davidt@yadt.co.uk>

16 years agoReplace the last susers calls in netinet6/ with privilege checks.
Bjoern A. Zeeb [Thu, 24 Jan 2008 08:25:59 +0000 (08:25 +0000)]
Replace the last susers calls in netinet6/ with privilege checks.

Introduce a new privilege allowing to set certain IP header options
(hop-by-hop, routing headers).

Leave a few comments to be addressed later.

Reviewed by: rwatson (older version, before addressing his comments)

16 years agoDifferentiate between addifaddr and delifaddr for the privilege check.
Bjoern A. Zeeb [Thu, 24 Jan 2008 08:14:38 +0000 (08:14 +0000)]
Differentiate between addifaddr and delifaddr for the privilege check.

Reviewed by: rwatson
MFC after: 2 weeks

16 years agoRemove one more alpha leftover.
Ruslan Ermilov [Thu, 24 Jan 2008 07:43:09 +0000 (07:43 +0000)]
Remove one more alpha leftover.

16 years agoMany improvements that have been collected over time:
Scott Long [Thu, 24 Jan 2008 07:26:53 +0000 (07:26 +0000)]
Many improvements that have been collected over time:

- Improve error handling for load operations.
- Fix a memory corruption bug when using certain linux management apps.
- Allocate all commands up front to avoid OOM deadlocks later on.

16 years agoFlag a hack.
Ruslan Ermilov [Thu, 24 Jan 2008 07:25:13 +0000 (07:25 +0000)]
Flag a hack.

16 years agoStyle.
Ruslan Ermilov [Thu, 24 Jan 2008 07:24:30 +0000 (07:24 +0000)]
Style.

16 years agoShorter equivalent of the command.
Ruslan Ermilov [Thu, 24 Jan 2008 07:04:12 +0000 (07:04 +0000)]
Shorter equivalent of the command.

16 years agoCosmetique: sort the list.
Ruslan Ermilov [Thu, 24 Jan 2008 07:03:21 +0000 (07:03 +0000)]
Cosmetique: sort the list.

16 years agoAdd a diagnostic note about "transmission error ... tx underrun, increasing
Tom Rhodes [Thu, 24 Jan 2008 00:39:38 +0000 (00:39 +0000)]
Add a diagnostic note about "transmission error ... tx underrun, increasing
tx start threshold ..."  Looking around on the mailing lists, and even having
one of these cards I agree the messages should be documented.

Bump doc date.

PR: 88477

16 years agoSupport source upgrades from at least 6.0-RELEASE.
Ruslan Ermilov [Wed, 23 Jan 2008 22:21:36 +0000 (22:21 +0000)]
Support source upgrades from at least 6.0-RELEASE.

Reviewed by: imp, obrien

16 years agotcp_usrreq.c:1.313 removed tcbinfo locking from tcp_usr_accept(), which
Robert Watson [Wed, 23 Jan 2008 21:15:51 +0000 (21:15 +0000)]
tcp_usrreq.c:1.313 removed tcbinfo locking from tcp_usr_accept(), which
while in principle a good idea, opened us up to a race inherrent to
the syncache's direct insertion of incoming TCP connections into the
"completed connection" listen queue, as it transpires that the socket
is inserted before the inpcb is fully filled in by syncache_expand().
The bug manifested with the occasional returning of 0.0.0.0:0 in the
address returned by the accept() system call, which occurred if accept
managed to execute tcp_usr_accept() before syncache_expand() had copied
the endpoint addresses into inpcb connection state.

Re-add tcbinfo locking around the address copyout, which has the effect
of delaying the copy until syncache_expand() has finished running, as
it is run while the tcbinfo lock is held.  This is undesirable in that
it increases contention on tcbinfo further, but a more significant
change will be required to how the syncache inserts new sockets in
order to fix this and keep more granular locking here.  In particular,
either more state needs to be passed into sonewconn() so that
pru_attach() can fill in the fields *before* the socket is inserted, or
the socket needs to be inserted in the incomplete connection queue
until it is actually ready to be used.

Reported by: glebius (and kris)
Tested by: glebius

16 years agoFix a regression introduced in rev 1.99: replace fclose(f) with a comment
Dag-Erling Smørgrav [Wed, 23 Jan 2008 20:57:59 +0000 (20:57 +0000)]
Fix a regression introduced in rev 1.99: replace fclose(f) with a comment
explaining why f cannot possibly be a valid FILE * at this point.

MFC after: 1 day

16 years ago- Document firewall_nat_enable related settings.
Chin-San Huang [Wed, 23 Jan 2008 16:08:35 +0000 (16:08 +0000)]
- Document firewall_nat_enable related settings.

Tested by: AB
MFC after: 1 month

16 years agoFix bundle xmit octets stats for packet-split operation mode.
Alexander Motin [Wed, 23 Jan 2008 11:47:09 +0000 (11:47 +0000)]
Fix bundle xmit octets stats for packet-split operation mode.

16 years agoo Add boot, gdb, nfsserver and opencrypto dirs to CSCOPEDIRS; sort.
Maxim Konovalov [Wed, 23 Jan 2008 08:50:34 +0000 (08:50 +0000)]
o Add boot, gdb, nfsserver and opencrypto dirs to CSCOPEDIRS; sort.

16 years agoTrack version # from the portable release.
Tim Kientzle [Wed, 23 Jan 2008 05:48:07 +0000 (05:48 +0000)]
Track version # from the portable release.

16 years agoExplain a subtle API change that was made recently.
Tim Kientzle [Wed, 23 Jan 2008 05:47:08 +0000 (05:47 +0000)]
Explain a subtle API change that was made recently.
Even though I believe this is a good change, it does
have the potential to break certain clients, so it's
good to document the reasoning behind the change.

16 years agoProperly pad symlinks when writing cpio "newc" format.
Tim Kientzle [Wed, 23 Jan 2008 05:43:26 +0000 (05:43 +0000)]
Properly pad symlinks when writing cpio "newc" format.
Thanks to: Jesse Barker for reporting this.
MFC after: 7 days

16 years ago"NONE" -> "ASCII" encoding
Andrey A. Chernov [Wed, 23 Jan 2008 04:25:10 +0000 (04:25 +0000)]
"NONE" -> "ASCII" encoding

16 years ago - sched_prio() should only adjust tdq_lowpri if the thread is running or on
Jeff Roberson [Wed, 23 Jan 2008 03:10:18 +0000 (03:10 +0000)]
 - sched_prio() should only adjust tdq_lowpri if the thread is running or on
   a run-queue.  If the priority is numerically raised only change lowpri
   if we're certain it will be correct.  Some slop is allowed however
   previously we could erroneously raise lowpri for an idle cpu that a
   thread had recently run on which lead to errors in load balancing
   decisions.

16 years agoFix longstanding mb/wc functions segfault if error occurse
Andrey A. Chernov [Wed, 23 Jan 2008 03:05:35 +0000 (03:05 +0000)]
Fix longstanding mb/wc functions segfault if error occurse
inside _<encoding>_init().
Currently _EUC_init() only was affected.

16 years agoBetter fix for longstanding segfault. Don't touch current locale at all
Andrey A. Chernov [Wed, 23 Jan 2008 02:17:27 +0000 (02:17 +0000)]
Better fix for longstanding segfault. Don't touch current locale at all
on unknown encoding. Previous fix resets it to POSIX.

16 years ago1) Add (void) cast to _none_init() (while I am here)
Andrey A. Chernov [Wed, 23 Jan 2008 01:57:26 +0000 (01:57 +0000)]
1) Add (void) cast to _none_init() (while I am here)
2) Fix longstanding segfault in mb/wc code when unknown encoding is specified
in the locale file (mb/wc functions becomes NULL in that case).

16 years agoConditionally add mklocale to bootstrap-tools
Andrey A. Chernov [Wed, 23 Jan 2008 00:16:37 +0000 (00:16 +0000)]
Conditionally add mklocale to bootstrap-tools

16 years agoBump FreeBSD_version after adding "ASCII" encoding to libc
Andrey A. Chernov [Wed, 23 Jan 2008 00:04:18 +0000 (00:04 +0000)]
Bump FreeBSD_version after adding "ASCII" encoding to libc

16 years agoTake advantage of the new physically contiguous 9K jumbos in 8.
Andrew Gallatin [Tue, 22 Jan 2008 22:04:31 +0000 (22:04 +0000)]
Take advantage of the new physically contiguous 9K jumbos in 8.

16 years agoAdd manpages for BUF_RECURSED(9) and BUF_ISLOCKED(9) and connect them to
Attilio Rao [Tue, 22 Jan 2008 21:26:35 +0000 (21:26 +0000)]
Add manpages for BUF_RECURSED(9) and BUF_ISLOCKED(9) and connect them to
the build.

Reviewed by: brueffer

16 years agoAdd the newly added function lockmgr_recursed() to the manpages.
Attilio Rao [Tue, 22 Jan 2008 20:16:09 +0000 (20:16 +0000)]
Add the newly added function lockmgr_recursed() to the manpages.

16 years agoReflect BUF_REFCNT(9) removal.
Attilio Rao [Tue, 22 Jan 2008 20:08:09 +0000 (20:08 +0000)]
Reflect BUF_REFCNT(9) removal.

Pointed out by: brueffer

16 years agoBUF_REFCNT(9) function no more exists, so just axe out the manpage.
Attilio Rao [Tue, 22 Jan 2008 20:02:24 +0000 (20:02 +0000)]
BUF_REFCNT(9) function no more exists, so just axe out the manpage.

16 years agoFix lock.9 manpage in order to recall lockmgr_disown() with 'man' command.
Attilio Rao [Tue, 22 Jan 2008 19:58:30 +0000 (19:58 +0000)]
Fix lock.9 manpage in order to recall lockmgr_disown() with 'man' command.

16 years agoCorrect a typo.
Tom Rhodes [Tue, 22 Jan 2008 19:16:09 +0000 (19:16 +0000)]
Correct a typo.

Noticed by: ru

16 years ago- Add new NTP servers provided by NIC.br (http://www.ntp.br)
Marcus Alves Grando [Tue, 22 Jan 2008 18:58:48 +0000 (18:58 +0000)]
- Add new NTP servers provided by NIC.br (http://www.ntp.br)
- Remove nonfunctional servers

PR: 119884
Approved by: simon
MFC after: 3 days

16 years agoDocument net.inet.tcp.syncookies_only using a description taken from
Tom Rhodes [Tue, 22 Jan 2008 18:35:23 +0000 (18:35 +0000)]
Document net.inet.tcp.syncookies_only using a description taken from
tcp_syncache.c revision 1.99 of andre's commit log.

PR: 107611

16 years agoIn 'fixit mode' running "fsck /dev/ad0s1a" typically complains that it
Ken Smith [Tue, 22 Jan 2008 16:35:10 +0000 (16:35 +0000)]
In 'fixit mode' running "fsck /dev/ad0s1a" typically complains that it
can't find fsck_4.2bsd because there was no fstab file saying what
filesystem type it is looking at so it got the filesystem type from
the disk's label.  When that fails admins who haven't been in this
situation before are most likely to try "fsck -t ufs /dev/ad0s1a" because
ufs is the type used in fstab files on working systems but that also fails
complaining it can't find fsck_ufs.

This just sets it up so /stand in the MFS image (/sbin is a symlink
to /stand) includes hard links pointing fsck_4.2bsd and fsck_ufs to
fsck_ffs which is what is present in /sbin on installed systems.

Prodded by: obrien
MFC after: 1 day

16 years agoCleanup after last commit (remove undefined variables).
Ruslan Ermilov [Tue, 22 Jan 2008 15:57:57 +0000 (15:57 +0000)]
Cleanup after last commit (remove undefined variables).

16 years agoXref flopen.3 which references this manual page.
Tom Rhodes [Tue, 22 Jan 2008 15:56:48 +0000 (15:56 +0000)]
Xref flopen.3 which references this manual page.

PR: 112650

16 years agoQuick note on how to disable malloc debugging in the top entry in this file.
Tom Rhodes [Tue, 22 Jan 2008 15:05:22 +0000 (15:05 +0000)]
Quick note on how to disable malloc debugging in the top entry in this file.

PR: 83621
Submitted by: Scott Robbins <scottro@nyc.rr.com> (original version)
Reviewed by: imp

16 years agoThe config-recursive target is not run during the normal install process, move
Tom Rhodes [Tue, 22 Jan 2008 12:23:30 +0000 (12:23 +0000)]
The config-recursive target is not run during the normal install process, move
it down to where it belongs.

Document 'all-depends-list' target and bump doc date.

PR: 119519
Submitted by: Yuri Pankov <yuri.pankov@gmail.com>
Reviewed by: flz

16 years agoRepeat iostat header after rows-3 instead of a hardcoded 20.
Giorgos Keramidas [Tue, 22 Jan 2008 11:18:51 +0000 (11:18 +0000)]
Repeat iostat header after rows-3 instead of a hardcoded 20.

Use ioctl() to get the window size in iostat(8), and force a new
header to be prepended to the output every time the current
window size changes.  Change the number of lines before each
header to `rows - 3' when the terminal is resized, so that the
full terminal length can be used for output lines.

PR: bin/119705
Submitted by: keramida
Approved by: maxim
MFC after: 2 weeks

16 years agoSmall fixes.
Christian Brueffer [Tue, 22 Jan 2008 07:40:21 +0000 (07:40 +0000)]
Small fixes.

16 years agoMake -l always have the SUSv2 meaning of "check links."
Tim Kientzle [Tue, 22 Jan 2008 07:23:44 +0000 (07:23 +0000)]
Make -l always have the SUSv2 meaning of "check links."
GNU tar changed -l to match SUSv2 a couple of years ago,
so bsdtar no longer needs to pander to this particular GNUism.

Thanks to: Debian maintainers
MFC after: 7 days

16 years agoUnderstand newly introduced "ASCII" encoding
Andrey A. Chernov [Tue, 22 Jan 2008 00:04:50 +0000 (00:04 +0000)]
Understand newly introduced "ASCII" encoding

16 years agoAdd a rather basic man page for the coda kernel module.
Robert Watson [Mon, 21 Jan 2008 23:59:22 +0000 (23:59 +0000)]
Add a rather basic man page for the coda kernel module.

MFC after: 3 days

16 years agoDuring PREINIT, when giving the interface the address 0.0.0.0, do it as an
Brooks Davis [Mon, 21 Jan 2008 23:54:57 +0000 (23:54 +0000)]
During PREINIT, when giving the interface the address 0.0.0.0, do it as an
alias to avoid distrubing other addresses.

PR: bin/119255
Submitted by: Jaakko Heinonen <jh at saunalahti dot fi>

16 years agoIntroduce new encoding: "ASCII"
Andrey A. Chernov [Mon, 21 Jan 2008 23:48:12 +0000 (23:48 +0000)]
Introduce new encoding: "ASCII"
It differs from default C/POSIX "NONE" mainly by stricter 8bit check
for mb*towc*/wc*tomb* family, returning EILSEQ

16 years agoNote that the punch_fw option does not work in securelevel 3 and Xref init.8.
Tom Rhodes [Mon, 21 Jan 2008 23:09:18 +0000 (23:09 +0000)]
Note that the punch_fw option does not work in securelevel 3 and Xref init.8.
Bump .Dd.

PR: 41807

16 years agoNote what options are only for DDS drives.
Tom Rhodes [Mon, 21 Jan 2008 22:08:05 +0000 (22:08 +0000)]
Note what options are only for DDS drives.

PR: 35608

16 years agoNote change in the supported upgrade path. Prior to this 5.3-release
Warner Losh [Mon, 21 Jan 2008 22:04:37 +0000 (22:04 +0000)]
Note change in the supported upgrade path.  Prior to this 5.3-release
and newer were supported upgrade paths to -current.  After today's
commits, 6.0-RELEASE and newer is supported for jumping to current.
Make that clear in the UPDATING entry.  For the pedants out there,
upgrading from FreeBSD_version 600029 and newer should still work.
This represents a point from May 29, 2005 forward.  The prior date was
October 16th 2004.

16 years agoPut "coda_rdwr: Internally Opening" printf generated by in-kernel writes
Robert Watson [Mon, 21 Jan 2008 21:39:08 +0000 (21:39 +0000)]
Put "coda_rdwr: Internally Opening" printf generated by in-kernel writes
to files, such as ktrace output, under CODA_VERBOSE.  Otherwise, each
such call to VOP_WRITE() results in a kernel printf.

MFC after: 3 days
Obtained from: NetBSD

16 years agoReplace references to VOP_LOCK() w/o LK_RETRY to vn_lock() with LK_RETRY,
Robert Watson [Mon, 21 Jan 2008 21:19:07 +0000 (21:19 +0000)]
Replace references to VOP_LOCK() w/o LK_RETRY to vn_lock() with LK_RETRY,
avoiding extra error handling, or in some cases, missing error handling.

MFC after: 3 days
Discussed with: kib

16 years agoDocument the 'maintainer' target.
Christian Brueffer [Mon, 21 Jan 2008 19:52:15 +0000 (19:52 +0000)]
Document the 'maintainer' target.

PR: 119699
Submitted by: Warren Block <wblock@wonkity.com>
MFC after: 3 days

16 years agoRemove 5.x and 6.x cruft - source upgrades to RELENG_8 from versions prior
David E. O'Brien [Mon, 21 Jan 2008 18:44:55 +0000 (18:44 +0000)]
Remove 5.x and 6.x cruft - source upgrades to RELENG_8 from versions prior
to RELENG_7 are not supported.

16 years agoAdjust paths for EDITOR and PAGER environment variables in the fixit
Ken Smith [Mon, 21 Jan 2008 17:25:48 +0000 (17:25 +0000)]
Adjust paths for EDITOR and PAGER environment variables in the fixit
shell.  This would break them for floppy based fixit mode which still
seems to use /stand except that vi(1) and more(1) don't exist in /stand
on the fixit floppy so it really doesn't matter what these settings are
there.  These paths work for CD-based fixit mode.

This is just "temporary" and on its way to 7.0-REL.  I'm too chicken to
make what is probably the correct adjustment this close to release.  It
seems /mnt2 is just a symbolic link, and stuff really gets mounted as
/dist.  Adjusting paths to that for 8.X is probably the right thing to
do and I'll try that after 7.0 is done.

Noticed by: gallatin
MFC after: 1 day

16 years agoFix cutoffs. This is just a cleanup and an optimization for unusual
Bruce Evans [Mon, 21 Jan 2008 13:46:21 +0000 (13:46 +0000)]
Fix cutoffs.  This is just a cleanup and an optimization for unusual
cases which are used mainly by regression tests.

As usual, the cutoff for tiny args was not correctly translated to
float precision.  It was 2**-54 but 2**-24 works.  It must be about
2**-precision, since the error from approximating log(1+x) by x is
about the same as |x|.  Exhaustive testing shows that 2**-24 gives
perfect rounding in round-to-nearest mode.

Similarly for the cutoff for being small, except this is not used by
so many other functions.  It was 2**-29 but 2**-15 works.  It must be
a bit smaller than sqrt(2**-precision), since the error from
approximating log(1+x) by x-x*x/2 is about the same as x*x.  Exhaustive
testing shows that 2**-15 gives a maximum error of 0.5052 ulps in
round-to-nearest-mode.  The algorithm for the general case is only good
for 0.8388 ulps, so this is sufficient (but it loses slightly on i386 --
then extra precision gives 0.5032 ulps for the general case).

While investigating this, I noticed that optimizing the usual case by
falling into a middle case involving a simple polynomial evaluation
(return x-x*x/2 instead of x here) is not such a good idea since it
gives an enormous pessimization of tinier args on machines for which
denormals are slow.  Float x*x/2 is denormal when |x| ~< 2**-64 and
x*x/2 is evaluated in float precision, so it can easily be denormal
for normal x.  This is even more interesting for general polynomial
evaluations.  Multiplying out large powers of x is normally a good
optimization since it reduces dependencies, but it creates denormals
starting with quite large x.

16 years agoAdd copyrights.
Ruslan Ermilov [Mon, 21 Jan 2008 13:26:33 +0000 (13:26 +0000)]
Add copyrights.

PR: 119136

16 years agoFix build.
Pyun YongHyeon [Mon, 21 Jan 2008 09:51:28 +0000 (09:51 +0000)]
Fix build.