]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoMove the NFSv4.1 client patches over from projects/nfsv4.1-client
rmacklem [Sat, 8 Dec 2012 22:52:39 +0000 (22:52 +0000)]
Move the NFSv4.1 client patches over from projects/nfsv4.1-client
to head. I don't think the NFS client behaviour will change unless
the new "minorversion=1" mount option is used. It includes basic
NFSv4.1 support plus support for pNFS using the Files Layout only.
All problems detecting during an NFSv4.1 Bakeathon testing event
in June 2012 have been resolved in this code and it has been tested
against the NFSv4.1 server available to me.
Although not reviewed, I believe that kib@ has looked at it.

11 years agoA number of places in the source tree still reference cuad.* after
eadler [Sat, 8 Dec 2012 22:16:36 +0000 (22:16 +0000)]
A number of places in the source tree still reference cuad.* after
sio(4) was deprecated by uart(4).

s/cuad/cuau/g/

PR: docs/171533
Reviewed by: imp
Approved by: cperciva (implicit)
MFC after: 3 weeks

11 years agoRemove outdated reference to tcp inflight limiting. It was removed
andre [Sat, 8 Dec 2012 21:03:14 +0000 (21:03 +0000)]
Remove outdated reference to tcp inflight limiting.  It was removed
a long time ago.

MFC after: 1 week

11 years agolibc: Add a missing header to a test program.
jilles [Sat, 8 Dec 2012 19:42:15 +0000 (19:42 +0000)]
libc: Add a missing header to a test program.

Usage of dup(), mkstemp() and unlink() needs <unistd.h>.

11 years agoAdd check for failure of mkstemp and setenv.
eadler [Sat, 8 Dec 2012 18:41:16 +0000 (18:41 +0000)]
Add check for failure of mkstemp and setenv.

Reviewed by: des
Approved by: cperciva (implicit)
Obtained from: DragonFlyBSD
MFC after: 1 week

11 years agotime: Use close-on-exec instead of fclose() in the child process.
jilles [Sat, 8 Dec 2012 17:41:39 +0000 (17:41 +0000)]
time: Use close-on-exec instead of fclose() in the child process.

11 years agoGet it compiling without INET and INET6 support (mainly userland stack).
tuexen [Sat, 8 Dec 2012 15:11:09 +0000 (15:11 +0000)]
Get it compiling without INET and INET6 support (mainly userland stack).

MFC after: 2 weeks

11 years agoMore warnings for zones that depend on the kern.ipc.maxsockets limit.
pjd [Sat, 8 Dec 2012 12:51:06 +0000 (12:51 +0000)]
More warnings for zones that depend on the kern.ipc.maxsockets limit.

Obtained from: WHEEL Systems

11 years agoAdd support for various Yamaha keyboards.
hselasky [Sat, 8 Dec 2012 09:58:11 +0000 (09:58 +0000)]
Add support for various Yamaha keyboards.

MFC after: 1 week
PR: usb/174254

11 years agoUse correct padding of the ABORT chunk in case of an user initiated
tuexen [Sat, 8 Dec 2012 09:50:38 +0000 (09:50 +0000)]
Use correct padding of the ABORT chunk in case of an user initiated
abort cause is used.

MFC after: 2 weeks

11 years agoFix a use-after-free bug in the Atheros fast-frames support.
adrian [Sat, 8 Dec 2012 09:48:03 +0000 (09:48 +0000)]
Fix a use-after-free bug in the Atheros fast-frames support.

Tested:

* AR5212 AP, AR5413 STA, iperf TCP STA->AP, destroyed and/or shutdown
  the STA vap during active iperf TCP traffic.

PR: kern/174273
MFC after: 1 week

11 years agoWhite-space cleanups.
pjd [Sat, 8 Dec 2012 09:23:05 +0000 (09:23 +0000)]
White-space cleanups.

11 years agoThe socket_zone UMA zone is now private to uipc_socket.c.
pjd [Sat, 8 Dec 2012 08:35:49 +0000 (08:35 +0000)]
The socket_zone UMA zone is now private to uipc_socket.c.

11 years agoEnsure that the padding of the last parameter of an INIT chunk
tuexen [Sat, 8 Dec 2012 08:22:33 +0000 (08:22 +0000)]
Ensure that the padding of the last parameter of an INIT chunk
is not included in the chunk length as required by RFC 4960.
While there, cleanup sctp_send_initiate().

MFC after: 2 weeks

11 years agoSync with Library of Congress list.
eadler [Sat, 8 Dec 2012 05:51:27 +0000 (05:51 +0000)]
Sync with Library of Congress list.

Approved by: cperciva (implicit)
Obtained from: DragonflyBSD
MFC after: 3 days

11 years agoMake sure we hold the SIM lock when calling xpt_free_path().
ken [Sat, 8 Dec 2012 04:55:06 +0000 (04:55 +0000)]
Make sure we hold the SIM lock when calling xpt_free_path().

Sponsored by: Spectra Logic Corporation
MFC after: 1 week

11 years agoFix the CTL OOA queue dumping code so that it does not hold a mutex
ken [Sat, 8 Dec 2012 04:16:07 +0000 (04:16 +0000)]
Fix the CTL OOA queue dumping code so that it does not hold a mutex
while doing a copyout.  That can cause a panic, because copyout
can trigger VM faults, and we can't handle VM faults while holding
a mutex.

The solution here is to malloc a separate buffer to hold the OOA
queue entries, so that we don't risk a VM fault while filling up
the buffer and we don't have to drop the lock.  The other solution
would be to wire the user's memory while filling their buffer with
copyout, but that would have been a little more complex.

Also fix a debugging parenthesis issue in ctl_abort_task() pointed
out by Chuck Tuffli.

Sponsored by: Spectra Logic Corporation
MFC after: 1 week

11 years agoFix a device departure bug for the the pass(4), enc(4), sg(4) and ch(4)
ken [Sat, 8 Dec 2012 04:03:04 +0000 (04:03 +0000)]
Fix a device departure bug for the the pass(4), enc(4), sg(4) and ch(4)
drivers.

The bug occurrs when a userland process has the driver instance
open and the underlying device goes away.  We get the devfs
callback that the device node has been destroyed, but not all of
the closes necessary to fully decrement the reference count on the
CAM peripheral.

The reason is that once devfs calls back and says the device has
been destroyed, it is moved off to deadfs, and devfs guarantees
that there will be no more open or close calls.  So the solution
is to keep track of how many outstanding open calls there are on
the device, and just release that many references when we get the
callback from devfs.

scsi_pass.c,
scsi_enc.c,
scsi_enc_internal.h: Add an open count to the softc in these
drivers.  Increment it on open and
decrement it on close.

When we get a devfs callback to say that
the device node has gone away, decrement
the peripheral reference count by the
number of still outstanding opens.

Make sure we don't access the peripheral
with cam_periph_unlock() after what might
be the final call to
cam_periph_release_locked().  The
peripheral might have been freed, and we
will be dereferencing freed memory.

scsi_ch.c,
scsi_sg.c: For the ch(4) and sg(4) drivers, add the
same changes described above, and in
addition, fix another bug that was
previously fixed in the pass(4) and enc(4)
drivers.

These drivers were calling destroy_dev()
from their cleanup routine, but that could
cause a deadlock because the cleanup
routine could be indirectly called from
the driver's close routine.  This would
cause a deadlock, because the device node
is being held open by the active close
call, and can't be destroyed.

Sponsored by: Spectra Logic Corporation
MFC after: 1 week

11 years agoAdd support for backchannels to the kernel RPC. Backchannels
rmacklem [Sat, 8 Dec 2012 00:29:16 +0000 (00:29 +0000)]
Add support for backchannels to the kernel RPC. Backchannels
are used by NFSv4.1 for callbacks. A backchannel is a connection
established by the client, but used for RPCs done by the server
on the client (callbacks). As a result, this patch mixes some
client side calls in the server side and vice versa. Some
definitions in the .c files were extracted out into a file called
krpc.h, so that they could be included in multiple .c files.
This code has been in projects/nfsv4.1-client for some time.
Although no one has given it a formal review, I believe kib@
has taken a look at it.

11 years agoFix a panic during CAM EDT traversal.
ken [Fri, 7 Dec 2012 23:48:54 +0000 (23:48 +0000)]
Fix a panic during CAM EDT traversal.

The problem was a race condition between the EDT traversal used by
things like 'camcontrol devlist', and CAM peripheral driver
removal.

The EDT traversal code holds the CAM topology lock, and wants
to show devices that have been invalidated.  It acquires a
reference to the peripheral to make sure the peripheral it is
examining doesn't go away.

However, because the peripheral removal code in camperiphfree()
drops the CAM topology lock to call the peripheral's destructor
routine, we can run into a situation where the EDT traversal
increments the peripheral reference count after free process is
already in progress.  At that point, the reference count is
ignored, because it was 0 when we started the process.

Fix this race by setting a flag, CAM_PERIPH_FREE, that I previously
added and checked in xptperiphtraverse() and xptpdperiphtravsere(),
but failed to use.  If the EDT traversal code sees that flag,
it will know that the peripheral free process has already started,
and that it should not access that peripheral.

Also, fix an inconsistency in the locking between
xptpdperiphtraverse() and xptperiphtraverse().  They now both
hold the CAM topology lock while calling the peripheral traversal
function.

cam_xpt.c: Change xptperiphtraverse() to hold the CAM topology
lock across calls to the traversal function.

Take out the comment in xptpdperiphtraverse() that
referenced the locking inconsistency.

cam_periph.c: Set the CAM_PERIPH_FREE flag when we are in the
process of freeing a peripheral driver.

Sponsored by: Spectra Logic Corporation
MFC after: 1 week

11 years agoConfigure UMA warnings for the following zones:
pjd [Fri, 7 Dec 2012 22:30:30 +0000 (22:30 +0000)]
Configure UMA warnings for the following zones:
- unp_zone: kern.ipc.maxsockets limit reached
- socket_zone: kern.ipc.maxsockets limit reached
- zone_mbuf: kern.ipc.nmbufs limit reached
- zone_clust: kern.ipc.nmbclusters limit reached
- zone_jumbop: kern.ipc.nmbjumbop limit reached
- zone_jumbo9: kern.ipc.nmbjumbo9 limit reached
- zone_jumbo16: kern.ipc.nmbjumbo16 limit reached

Note that those warnings are printed not often than every five minutes and can
be globally turned off by setting sysctl/tunable vm.zone_warnings to 0.

Discussed on: arch
Obtained from: WHEEL Systems
MFC after: 2 weeks

11 years agoImplemented uma_zone_set_warning(9) function that sets a warning, which
pjd [Fri, 7 Dec 2012 22:27:13 +0000 (22:27 +0000)]
Implemented uma_zone_set_warning(9) function that sets a warning, which
will be printed once the given zone becomes full and cannot allocate an
item. The warning will not be printed more often than every five minutes.

All UMA warnings can be globally turned off by setting sysctl/tunable
vm.zone_warnings to 0.

Discussed on: arch
Obtained from: WHEEL Systems
MFC after: 2 weeks

11 years agoMake use of the fact that uma_zone_set_max(9) already returns actual limit set.
pjd [Fri, 7 Dec 2012 22:23:53 +0000 (22:23 +0000)]
Make use of the fact that uma_zone_set_max(9) already returns actual limit set.

11 years agoMore style cleanups.
pjd [Fri, 7 Dec 2012 22:22:04 +0000 (22:22 +0000)]
More style cleanups.

11 years agoStyle cleanups.
pjd [Fri, 7 Dec 2012 22:19:41 +0000 (22:19 +0000)]
Style cleanups.

11 years ago- Make socket_zone static - it is used only in this file.
pjd [Fri, 7 Dec 2012 22:15:51 +0000 (22:15 +0000)]
- Make socket_zone static - it is used only in this file.
- Update maxsockets on uma_zone_set_max().

Obtained from: WHEEL Systems

11 years agoStyle cleanups.
pjd [Fri, 7 Dec 2012 22:13:33 +0000 (22:13 +0000)]
Style cleanups.

11 years agoThere is no need anymore to include vm/uma.h after r241726.
pjd [Fri, 7 Dec 2012 22:05:42 +0000 (22:05 +0000)]
There is no need anymore to include vm/uma.h after r241726.

Obtained from: WHEEL Systems

11 years agoRe-disable GSSAPI, which does not build on several archs.
erwin [Fri, 7 Dec 2012 16:05:04 +0000 (16:05 +0000)]
Re-disable GSSAPI, which does not build on several archs.

Approved by: delphij (mentor)

11 years agoUpdate to 9.8.4-P1.
erwin [Fri, 7 Dec 2012 12:39:58 +0000 (12:39 +0000)]
Update to 9.8.4-P1.

Security Fixes

   Prevents named from aborting with a require assertion failure
   on servers with DNS64 enabled.  These crashes might occur as a
   result of  specific queries that are received.

New Features

*  Elliptic Curve Digital Signature Algorithm keys and signatures in
   DNSSEC are now supported per RFC 6605. [RT #21918]

Feature Changes

*  Improves OpenSSL error logging [RT #29932]

*  nslookup now returns a nonzero exit code when it is unable to get
   an answer.  [RT #29492]

Other critical bug fixes are included.

Approved by: delphij (mentor)
MFC after: 3 days
Security: CVE-2012-5688
Sponsored by: DK Hostmaster A/S

11 years agoAllow KASSERT to log instead of panic.
alfred [Fri, 7 Dec 2012 08:25:08 +0000 (08:25 +0000)]
Allow KASSERT to log instead of panic.

This is to allow debug images to be used without taking down the
system when non-fatal asserts are hit.

The following sysctls are added:

debug.kassert.warn_only: 1 = log, 0 = panic

debug.kassert.do_ktr: set to a ktr mask for logging via KTR

debug.kassert.do_log: 1 = log, 0 = quiet

debug.kassert.warnings: stats, number of kasserts hit

debug.kassert.log_panic_at:
  number of kasserts before we actually panic, 0 = never

debug.kassert.log_pps_limit: pps limit for log messages

debug.kassert.log_mute_at: stop warning after N kasserts, 0 = never stop

debug.kassert.kassert: set this sysctl to trigger a kassert

Discussed with: scottl, gnn, marcel
Sponsored by: iXsystems

11 years agoTypo in a comment.
rpaulo [Fri, 7 Dec 2012 07:08:39 +0000 (07:08 +0000)]
Typo in a comment.

11 years agoMake this work for 64 bit binaries.
rpaulo [Fri, 7 Dec 2012 07:02:39 +0000 (07:02 +0000)]
Make this work for 64 bit binaries.

11 years agoAdd XC900 SKU mapping.
adrian [Fri, 7 Dec 2012 06:38:30 +0000 (06:38 +0000)]
Add XC900 SKU mapping.

11 years agoAdd a new 900MHz GSM regulatory SKU for the Xagyl Communications XC900M.
adrian [Fri, 7 Dec 2012 06:34:46 +0000 (06:34 +0000)]
Add a new 900MHz GSM regulatory SKU for the Xagyl Communications XC900M.

The XC900M acts as a Ubiquiti XR9 (and I _think_ SR9) by default;
it uses the same 900MHz<->2.4GHz downconverter mapping.

However it has an alternative frequency mapping which squeezes in a couple
more half/quarter rate channels.  Since the default HAL doesn't support
fractional tuning (sub-1MHz) in 2.4GHz mode on the AR5413/AR5414, they
implement it using a jumper.

Datasheet: http://www.xagyl.com/download/XC900M_Datasheet.pdf

Thankyou to Xagyl Communications for the XC900M NICs and Edgar Martinez
for organising the donation.

Tested:

* XC900M <-> XC900M
* Ubiquiti XR9 <-> XC900M

TODO:

* Test against SR9 and GZ901 if possible (the IEEE channel<->frequency
  mapping may not match up, thanks to the slightly different channels
  involved)

11 years agoUse uint instead of int for flags exported via sysctl.
alfred [Fri, 7 Dec 2012 05:55:48 +0000 (05:55 +0000)]
Use uint instead of int for flags exported via sysctl.

11 years agoDocument pffinddomain().
kevlo [Fri, 7 Dec 2012 02:29:32 +0000 (02:29 +0000)]
Document pffinddomain().

Reviewed by: glebius

11 years agoDocument that socket(2) may fail with EAFNOSUPPORT if the family cannot
kevlo [Fri, 7 Dec 2012 02:26:08 +0000 (02:26 +0000)]
Document that socket(2) may fail with EAFNOSUPPORT if the family cannot
be found.

Reviewed by: glebius
Obtained from: NetBSD

11 years ago- according to POSIX, make socket(2) return EAFNOSUPPORT rather than
kevlo [Fri, 7 Dec 2012 02:22:48 +0000 (02:22 +0000)]
- according to POSIX, make socket(2) return EAFNOSUPPORT rather than
  EPROTONOSUPPORT if the address family is not supported.
- introduce pffinddomain() to find a domain by family and use it as
  appropriate.

Reviewed by: glebius

11 years agoFix build: reflect the increased field number.
delphij [Fri, 7 Dec 2012 01:36:53 +0000 (01:36 +0000)]
Fix build: reflect the increased field number.

11 years agoAdd amd64 implementations for 8-byte bus_space routines.
jimharris [Thu, 6 Dec 2012 22:33:31 +0000 (22:33 +0000)]
Add amd64 implementations for 8-byte bus_space routines.

Submitted by: Carl Delsey <carl.r.delsey@intel.com>
Discussed with: jhb, rwatson
Reviewed by: jimharris
MFC after: 1 week

11 years ago- Rewrite radius servers traversal algorithm.
sem [Thu, 6 Dec 2012 19:00:37 +0000 (19:00 +0000)]
- Rewrite radius servers traversal algorithm.
- Add functions for working with IPv6 attributes.

Approved by: ae

11 years agoAdd PCI device ID for 8-channel IDT NVMe controller, and clarify that the
jimharris [Thu, 6 Dec 2012 15:36:24 +0000 (15:36 +0000)]
Add PCI device ID for 8-channel IDT NVMe controller, and clarify that the
previously defined IDT PCI device ID was for a 32-channel controller.

Submitted by: Joe Golio <joseph.golio@isilon.com>

11 years ago Rule memory garbage collecting in new pf scans only states that are on
glebius [Thu, 6 Dec 2012 08:38:14 +0000 (08:38 +0000)]
  Rule memory garbage collecting in new pf scans only states that are on
id hash. If a state has been disconnected from id hash, its rule pointers
can no longer be dereferenced, and referenced memory can't be modified.
Thus, move rule statistics from pf_free_rule() to pf_unlink_rule() and
update them prior to releasing id hash slot lock.

Reported by: Ian FREISLICH <ianf cloudseed.co.za>

11 years agoClose possible races between state deletion and sent being sent out
glebius [Thu, 6 Dec 2012 08:32:28 +0000 (08:32 +0000)]
Close possible races between state deletion and sent being sent out
from pfsync:
- Call into pfsync_delete_state() holding the state lock.
- Set the state timeout to PFTM_UNLINKED after state has been moved
  to the PFSYNC_S_DEL queue in pfsync.

Reported by: Ian FREISLICH <ianf cloudseed.co.za>

11 years ago Remove extra PFSYNC_LOCK() in pfsync_bulk_update() which lead to lock
glebius [Thu, 6 Dec 2012 08:22:08 +0000 (08:22 +0000)]
  Remove extra PFSYNC_LOCK() in pfsync_bulk_update() which lead to lock
recursion.

Reported by: Ian FREISLICH <ianf cloudseed.co.za>

11 years ago Revert erroneous r242693. A state may have PFTM_UNLINKED being on the
glebius [Thu, 6 Dec 2012 08:15:06 +0000 (08:15 +0000)]
  Revert erroneous r242693. A state may have PFTM_UNLINKED being on the
PFSYNC_S_DEL queue of pfsync.

11 years agoEliminate superfluous code.
davidxu [Thu, 6 Dec 2012 06:29:08 +0000 (06:29 +0000)]
Eliminate superfluous code.

11 years agoAdd the Programmer Dvorak Keyboard Layout
eadler [Thu, 6 Dec 2012 01:44:19 +0000 (01:44 +0000)]
Add the Programmer Dvorak Keyboard Layout

PR: conf/173950
Submitted by: clutton <mbsd@isgroup.com.ua>
Approved by: cperciva

11 years agoChange the default to 'cru' for speed reasons.
eadler [Thu, 6 Dec 2012 01:31:34 +0000 (01:31 +0000)]
Change the default to 'cru' for speed reasons.

Submitted by: Erik Cederstrand <erik@cederstrand.dk>
Reviewed by: imp, toolchain@
Approved by: cperciva
MFC after: 2 weeks

11 years agoClean up hardcoded ar(1) flags in the tree to use the global ARFLAGS in
eadler [Thu, 6 Dec 2012 01:31:25 +0000 (01:31 +0000)]
Clean up hardcoded ar(1) flags in the tree to use the global ARFLAGS in
share/mk/sys.mk instead.

This is part of a medium term project to permit deterministic builds of
FreeBSD.

Submitted by: Erik Cederstrand <erik@cederstrand.dk>
Reviewed by: imp, toolchain@
Approved by: cperciva
MFC after: 2 weeks

11 years agoPrefer the use of initalizer lists to ctor assignment.
eadler [Thu, 6 Dec 2012 01:25:21 +0000 (01:25 +0000)]
Prefer the use of initalizer lists to ctor assignment.

Approved by: cperciva
MFC after: 2 weeks

11 years agoAvoid the creation of a temporary object by using the prefix operator
eadler [Thu, 6 Dec 2012 01:25:17 +0000 (01:25 +0000)]
Avoid the creation of a temporary object by using the prefix operator
for non-primitive types.

Approved by: cperciva
MFC after: 2 weeks

11 years agoConstify where possible
eadler [Thu, 6 Dec 2012 01:25:14 +0000 (01:25 +0000)]
Constify where possible

Approved by: cperciva
MFC after: 2 weeks

11 years agoFixup r243901:
attilio [Wed, 5 Dec 2012 22:32:12 +0000 (22:32 +0000)]
Fixup r243901:
- As the comment report, CALLOUT_LOCAL_ALLOC cannot be checked
  directly from the callout flags but might be checked by a cached
  value.  Hence, do so before to actually remove the callout, when
  needed, in softclock_call_cc().
- In softclock_call_cc() also add a comment in the waiting and deferred
  migration case explaining that the dereference should be safe
  because of the migration dereference invariants.

Additively:
- In softclock_call_cc(), for the deferred migration case, move all the
  accesses to callout structure after the comment stating the callout
  must not be destroyed.
- For consistency with this last tweak, use cached c_flags for the
  KASSERT() in the deferred migration case.  It is not strictly necessary
  but this way all the callout accesses happen after the above mentioned
  comment, improving consistency.

Pointy hat to: me
Sponsored by: Isilon Systems / EMC Corporation
Reviewed by: kib
MFC after: 2 weeks
X-MFC: 243901

11 years agoDon't write-back the cachelines if we really just want to invalidate them.
cognet [Wed, 5 Dec 2012 21:07:27 +0000 (21:07 +0000)]
Don't write-back the cachelines if we really just want to invalidate them.

Spotted out by: Ian Lepore <freebsd at damnhippie DOT dyndns dot org>

11 years agoFix an old bug in devd, where it uses std::sort() to sort the various
dim [Wed, 5 Dec 2012 20:50:40 +0000 (20:50 +0000)]
Fix an old bug in devd, where it uses std::sort() to sort the various
lists it reads from its configuration files on the priority field.

Because some items in the lists have the same priority, and std::sort()
is not stable, the exact order in which the items are enumerated does
not have to correspond to the order they appear in the configuration
files.

Apparently this was never noticed with libstdc++, but with libc++ it
could cause the "uhid" entry from /etc/devd/usb.conf to be used instead
of the "ums" entry (which is earlier in the file).  This caused the
problem described in the PR: the USB mouse module was never loaded, and
the other actions (such as starting moused) were not executed.

To fix the problem, make devd use std:stable_sort() instead.

Reported by: Jan Beich <jbeich@tormail.org>
PR: bin/172958
MFC after: 2 weeks

11 years agoremove redundant yyparse declarations
bapt [Wed, 5 Dec 2012 20:28:44 +0000 (20:28 +0000)]
remove redundant yyparse declarations

PR: conf/174079
Submitted by: Garrett Cooper <yanegomi@gmail.com>

11 years agoDon't call bus_dmamap_load in CAM_DIR_NONE case, since there is nothing
jimharris [Wed, 5 Dec 2012 20:21:33 +0000 (20:21 +0000)]
Don't call bus_dmamap_load in CAM_DIR_NONE case, since there is nothing
to map, and technically this isn't allowed.

Functionally, it works OK (at least on x86) to call bus_dmamap_load with
a NULL data pointer and zero length, so this is primarily for correctness
and consistency with other drivers.

While here, remove check in isci_io_request_construct for nseg==0.
Previously, bus_dmamap_load would pass nseg==1, even for case where
buffer is NULL and length = 0, which allowed CAM_DIR_NONE CCBs
to get processed.  This check is not correct though, and needed to be
removed both for the changes elsewhere in this patch, as well as jeff's
preliminary bus_dmamap_load_ccb patch (which uncovered all of this in
the first place).

MFC after: 3 days

11 years ago- Move definition of V_deembed_scopeid to scope6_var.h.
hrs [Wed, 5 Dec 2012 19:45:24 +0000 (19:45 +0000)]
- Move definition of V_deembed_scopeid to scope6_var.h.
- Deembed scope id in L3 address in in6_lltable_dump().
- Simplify scope id recovery in rtsock routines.
- Remove embedded scope id handling in ndp(8) and route(8) completely.

11 years agoThe softclock_call_cc() is executing with the callout already removed
kib [Wed, 5 Dec 2012 19:02:22 +0000 (19:02 +0000)]
The softclock_call_cc() is executing with the callout already removed
from the callwheel. Calculate the cc->cc_next before removing the
callout, otherwise the code followed the invalid tailq links.  After
this, make softclock_call_cc() return void, since it always return
cc->cc_next, which is immediately available to the softclock()
anyway. This also allows to eliminate a label under #ifdef SMP.

Remove the assignment of cc->cc_next from callout_cc_del(), since the
function is called with the callout already removed from callwheel.

If cancelling the migration, also clear the CALLOUT_DFRMIGRATION flag.

Postpone the free of the timeout(9) allocated callouts after the
migration checks are done.

Add some more strict asserts about the state of the callout in
callout_call_cc().

Reviewed by: attilio
Reported and tested by: pho (previous version)
MFC after: 2 weeks

11 years agoCheck for lockmgr recursion in case of disown and downgrade and panic
attilio [Wed, 5 Dec 2012 15:11:01 +0000 (15:11 +0000)]
Check for lockmgr recursion in case of disown and downgrade and panic
also in !debugging kernel rather than having "undefined" behaviour.

Tested by: avg
MFC after: 1 week

11 years agoUse Bernard Baruch's full name.
eadler [Wed, 5 Dec 2012 13:57:00 +0000 (13:57 +0000)]
Use Bernard Baruch's full name.

The words "old than" seem to be quoted as "older than" by some sources,
so use the more likely and grammatically correct text.

PR: docs/173868
Submitted by: Chris Petrik <c.petrik.sosa@gmail.com>
Approved by: cperciva
MFC after: 1 week

11 years agoSimplify string duplication: use strdup instead of malloc + strcpy
eadler [Wed, 5 Dec 2012 13:56:56 +0000 (13:56 +0000)]
Simplify string duplication: use strdup instead of malloc + strcpy

Submitted by: db
Approved by: cperciva
MFC after: 2 weeks

11 years agoAvoid overflowing the file buffer
eadler [Wed, 5 Dec 2012 13:56:52 +0000 (13:56 +0000)]
Avoid overflowing the file buffer

Submitted by: db
Approved by: cperciva
MFC after: 2 weeks

11 years agoUse strdup instead of malloc + strcpy
eadler [Wed, 5 Dec 2012 13:56:49 +0000 (13:56 +0000)]
Use strdup instead of malloc + strcpy

Submitted by: db
Approved by: cperciva
MFC after: 2 weeks

11 years agoAvoid overflow of file buffer
eadler [Wed, 5 Dec 2012 13:56:46 +0000 (13:56 +0000)]
Avoid overflow of file buffer

Submitted by: db
Approved by: cperciva
MFC after: 2 weeks

11 years agoRemove useless check for NULL prior to free.
eadler [Wed, 5 Dec 2012 13:56:43 +0000 (13:56 +0000)]
Remove useless check for NULL prior to free.

Approved by: cperciva
MFC after: 2 weeks

11 years agoRemove hack to emulate effective uid and just use the EUID's name in the
eadler [Wed, 5 Dec 2012 13:56:39 +0000 (13:56 +0000)]
Remove hack to emulate effective uid and just use the EUID's name in the
first place.  I was unaware of this option when originally committing
this change.

Submitted by: gcooper
Approved by: cperciva
MFC after: 3 days

11 years agoRemove pointless check for the existence of /usr/bin/less which exists
eadler [Wed, 5 Dec 2012 13:56:36 +0000 (13:56 +0000)]
Remove pointless check for the existence of /usr/bin/less which exists
in all configurations.

Reviewed by: mjg
Approved by: cperciva
MFC after: 2 weeks

11 years agoAdd ability to mergemaster to permit the user to type
eadler [Wed, 5 Dec 2012 13:56:32 +0000 (13:56 +0000)]
Add ability to mergemaster to permit the user to type
the absolute path to PAGER if mergemaster can not find
the one already set.

Reviewed by: mjg
Approved by: cperciva
MFC after: 2 weeks

11 years agoConnect organization.dot to the build
eadler [Wed, 5 Dec 2012 13:05:24 +0000 (13:05 +0000)]
Connect organization.dot to the build

Approved by: cperciva
MFC after: 3 days

11 years agoVendor import of Bind 9.8.4-P1
erwin [Wed, 5 Dec 2012 13:00:54 +0000 (13:00 +0000)]
Vendor import of Bind 9.8.4-P1

Approved by: delphij (mentor)
Sponsored by: DK Hostmaster A/S

11 years agoVendor import of Bind 9.8.4
erwin [Wed, 5 Dec 2012 12:53:50 +0000 (12:53 +0000)]
Vendor import of Bind 9.8.4

Approved by: delphij (mentor)
Sponsored by: DK Hostmaster A/S

11 years agoif PACKAGESITE url scheme is not 'file://', always try to revolv SRV records and
bapt [Wed, 5 Dec 2012 11:35:50 +0000 (11:35 +0000)]
if PACKAGESITE url scheme is not 'file://', always try to revolv SRV records and
use them if any. It allows the bootstrap to use directly pkg.FreeBSD.org instead
of pkgbeta.FreeBSD.org

MFC after: 1 month

11 years ago Mechanically substitute flags from historic mbuf allocator with
glebius [Wed, 5 Dec 2012 08:04:20 +0000 (08:04 +0000)]
  Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags within sys.

Exceptions:

- sys/contrib not touched
- sys/mbuf.h edited manually

11 years agoRemove dead code that clang refuses to compile.
rpaulo [Wed, 5 Dec 2012 04:22:53 +0000 (04:22 +0000)]
Remove dead code that clang refuses to compile.

11 years agoFix a race between kern_setitimer() and realitexpire(), where the
kib [Tue, 4 Dec 2012 20:49:39 +0000 (20:49 +0000)]
Fix a race between kern_setitimer() and realitexpire(), where the
callout is started before kern_setitimer() acquires process mutex, but
looses a race and kern_setitimer() gets the process mutex before the
callout.  Then, assuming that new specified struct itimerval has
it_interval zero, but it_value non-zero, the callout, after it starts
executing again, clears p->p_realtimer.it_value, but kern_setitimer()
already rescheduled the callout.

As the result of the race, both p_realtimer is zero, and the callout
is rescheduled. Then, in the exit1(), the exit code sees that it_value
is zero and does not even try to stop the callout. This allows the
struct proc to be reused and eventually the armed callout is
re-initialized.  The consequence is the corrupted callwheel tailq.

Use process mutex to interlock the callout start, which fixes the race.

Reported and tested by: pho
Reviewed by: jhb
MFC after: 2 weeks

11 years agoDo not allocate buffer of the 255 bytes length on the stack.
kib [Tue, 4 Dec 2012 20:49:04 +0000 (20:49 +0000)]
Do not allocate buffer of the 255 bytes length on the stack.

Reported and tested by: sig6247@gmail.com
MFC after: 1 week

11 years agoFix fallout from r243019, which broke parsing of shortened network
glebius [Tue, 4 Dec 2012 20:05:01 +0000 (20:05 +0000)]
Fix fallout from r243019, which broke parsing of shortened network
prefixes.

Reported and tested by: delphij

11 years ago- Fix LOR in sa6_recoverscope() in rt_msg2()[1].
hrs [Tue, 4 Dec 2012 17:12:23 +0000 (17:12 +0000)]
- Fix LOR in sa6_recoverscope() in rt_msg2()[1].
- Check V_deembed_scopeid before checking if sa_family == AF_INET6.
- Fix scope id handing in route(8)[2] and ifconfig(8).

Reported by: rpaulo[1], Mateusz Guzik[1], peter[2]

11 years agolibc: Use the new 'e' fopen() mode option to simplify fstab.c.
jilles [Tue, 4 Dec 2012 16:54:43 +0000 (16:54 +0000)]
libc: Use the new 'e' fopen() mode option to simplify fstab.c.

No functional change is intended.

11 years agoUse absolute path for /usr/libexec/ld-elf.so.1 symlink.
pjd [Tue, 4 Dec 2012 14:36:01 +0000 (14:36 +0000)]
Use absolute path for /usr/libexec/ld-elf.so.1 symlink.

Requested by: kan, kib

Use -h flags for chflags, so we won't remove 'schg' flag from system's
/libexec/ld-elf.so.1.

MFC after: 2 weeks

11 years agoFix typo.
kib [Tue, 4 Dec 2012 14:07:17 +0000 (14:07 +0000)]
Fix typo.

Submitted by: bjk
MFC after: 3 days

11 years agoDo not change entire BINDIR, it might be needed later, just change
pjd [Tue, 4 Dec 2012 12:51:33 +0000 (12:51 +0000)]
Do not change entire BINDIR, it might be needed later, just change
symlink target.

MFC after: 2 weeks

11 years agoChange /usr/libexec/ld-elf.so.1 to point at ../../libexec/ld-elf.so.1
pjd [Tue, 4 Dec 2012 12:39:26 +0000 (12:39 +0000)]
Change /usr/libexec/ld-elf.so.1 to point at ../../libexec/ld-elf.so.1
instead of /libexec/ld-elf.so.1. Below in the Makefile we execute
'chflags noschg ${DESTDIR}/usr/libexec/ld-elf.so.1', which follows
symlink and removes 'schg' flag from system's /libexec/ld-elf.so.1
instead of the one in DESTDIR. It is also more friendly to use
replative paths in symlink in case of jail/chroot environments.

Obtained from: WHEEL Systems
MFC after: 2 weeks

11 years agoFlush stdout after RTM_IFANNOUNCE message.
glebius [Tue, 4 Dec 2012 11:10:01 +0000 (11:10 +0000)]
Flush stdout after RTM_IFANNOUNCE message.

PR: bin/151600
Submitted by: Eric van Gyzen <eric vangyzen.net>

11 years agoNo need to be root when running with -t or -d.
glebius [Tue, 4 Dec 2012 10:24:50 +0000 (10:24 +0000)]
No need to be root when running with -t or -d.

11 years agoDocument that bind(2) can fail with EAFNOSUPPORT.
kevlo [Tue, 4 Dec 2012 09:53:09 +0000 (09:53 +0000)]
Document that bind(2) can fail with EAFNOSUPPORT.

Reviewed by: glebius

11 years agoMechanically substitute flags from historic mbuf allocator with
glebius [Tue, 4 Dec 2012 09:32:43 +0000 (09:32 +0000)]
Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags in sys/dev.

11 years agoRemove superfluous paragraph macro.
joel [Tue, 4 Dec 2012 09:02:49 +0000 (09:02 +0000)]
Remove superfluous paragraph macro.

11 years agoRemove snapshots.jp.freebsd.org. It stopped working years ago.
joel [Tue, 4 Dec 2012 07:22:15 +0000 (07:22 +0000)]
Remove snapshots.jp.freebsd.org. It stopped working years ago.

Discussed with: hrs

11 years agoreplace bit shifting loop with 1<<fls(n), improve comments.
alfred [Tue, 4 Dec 2012 05:28:20 +0000 (05:28 +0000)]
replace bit shifting loop with 1<<fls(n), improve comments.

Reviewed by: davide

11 years ago- Move EXAMPLES descriptions to before the actual command
bdrewery [Tue, 4 Dec 2012 00:53:20 +0000 (00:53 +0000)]
- Move EXAMPLES descriptions to before the actual command
- Add mdoc macros for EXAMPLES

Reviewed by: eadler
Approved by: gjb
MFC after: 3 days

11 years agoFix typos in the previous commit.
jkim [Tue, 4 Dec 2012 00:44:31 +0000 (00:44 +0000)]
Fix typos in the previous commit.

11 years agoTidy up bsd.cpu.mk for X86 CPUs:
jkim [Tue, 4 Dec 2012 00:37:17 +0000 (00:37 +0000)]
Tidy up bsd.cpu.mk for X86 CPUs:

- Do not limit recent processors to "prescott" class for i386 target.  There
is no reason for this hack because clang is default now.  On top of that, it
will only grow indefinitely over time.
- Add more CPUTYPEs, i.e., "athlon-fx", "core-avx2", "atom", "penryn", and
"yonah".  Note "penryn" and "yonah" are intentionally undocumented because
they are not supported by gcc and marked deprecated by clang.
- Add more CPUTYPE aliases, i.e., "barcelona" (-> amdfam10), "westmere" and
"nehalem" (-> corei7).  Note these are intentionally undocumented because
they are not supported by (base) gcc and/or clang.  However, LLVM (backend)
seems to "know" the differences.  Most likely, they were deprecated with
other vendor code names and clang did not bother implementing them at all.
- Add i686 to MACHINE_CPU for "c3-2" (VIA Nehemiah).  Both gcc & clang treat
it like an i686-class processor.
- Add IDT "winchip2" and "winchip-c6" for completeness (undocumented).
- Order processors per make.conf example, i.e., CPU vendors and models.
- Tidy up make.conf example, i.e., remove "by gcc" (because we have aliases)
and remove "prescott" from AMD64 architecture (because it is not correct).

11 years agoDocument the interpretation of the negative value of ticks for
kib [Tue, 4 Dec 2012 00:32:12 +0000 (00:32 +0000)]
Document the interpretation of the negative value of ticks for
taskqueue_enqueue_timeout(9).

MFC after: 3 days

11 years agoMethodise the BT diversity configuration function; so the AR9285
adrian [Tue, 4 Dec 2012 00:02:46 +0000 (00:02 +0000)]
Methodise the BT diversity configuration function; so the AR9285
can correctly override it.

This was missed in the previous commit.

11 years agoOverride the BT coex parameter function for the AR9285.
adrian [Tue, 4 Dec 2012 00:01:42 +0000 (00:01 +0000)]
Override the BT coex parameter function for the AR9285.

11 years agoReformat/reindent.
adrian [Tue, 4 Dec 2012 00:01:24 +0000 (00:01 +0000)]
Reformat/reindent.