]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/log
FreeBSD/stable/9.git
11 years agoMerge r246619 from head:
gavin [Sun, 5 May 2013 16:42:06 +0000 (16:42 +0000)]
Merge r246619 from head:
  Correct spelling of "daemon".  No .Dd bump.
  Noticed by:   Nathan Rich <Nathan.Rich dynastysystems com>

git-svn-id: svn://svn.freebsd.org/base/stable/9@250277 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r250028:
kib [Sun, 5 May 2013 06:32:13 +0000 (06:32 +0000)]
MFC r250028:
Assert that the object type for the vnode' non-NULL v_object, passed
to vnode_pager_setsize(), is either OBJT_VNODE, or, if vnode was
already reclaimed, OBJT_DEAD.

More, if the object is terminated, do not perform the resizing operation.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250263 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r250026:
kib [Sun, 5 May 2013 06:25:28 +0000 (06:25 +0000)]
MFC r250026:

Convert panic() into KASSERT().

git-svn-id: svn://svn.freebsd.org/base/stable/9@250262 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r249630
rmacklem [Sat, 4 May 2013 22:05:43 +0000 (22:05 +0000)]
MFC: r249630
When an NFS unmount occurs, once vflush() writes the last dirty
buffer for the last vnode on the mount back to the server, it
returns. At that point, the code continues with the unmount,
including freeing up the nfs specific part of the mount structure.
It is possible that an nfsiod thread will try to check for an
empty I/O queue in the nfs specific part of the mount structure
after it has been free'd by the unmount. This patch avoids this problem by
setting the iodmount entries for the mount back to NULL while holding the
mutex in the unmount and checking the appropriate entry is non-NULL after
acquiring the mutex in the nfsiod thread.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250258 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r249623
rmacklem [Sat, 4 May 2013 21:56:39 +0000 (21:56 +0000)]
MFC: r249623
Both NFS clients can deadlock when using the "rdirplus" mount
option. This can occur when an nfsiod thread that already holds
a buffer lock attempts to acquire a vnode lock on an entry in
the directory (a LOR) when another thread holding the vnode lock
is waiting on an nfsiod thread. This patch avoids the deadlock by disabling
readahead for this case, so the nfsiod threads never do readdirplus.
Since readaheads for directories need the directory offset cookie
from the previous read, they cannot normally happen in parallel.
As such, testing by jhb@ and myself didn't find any performance
degredation when this patch is applied. If there is a case where
this results in a significant performance degradation, mounting
without the "rdirplus" option can be done to re-enable readahead
for directories.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250257 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r248933:
mdf [Sat, 4 May 2013 18:44:14 +0000 (18:44 +0000)]
MFC r248933:

Use a shared lock for VOP_GETEXTATTR, as it is a read-like operation.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250248 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r245304 (by theraven):
dim [Sat, 4 May 2013 15:43:09 +0000 (15:43 +0000)]
MFC r245304 (by theraven):

  Merge new version of libcxxrt.  This brings in three fixes:

  - Don't treat pointers to members as pointers in catch blocks
    (they're usually fat pointers).

  - Correctly catch foreign exceptions in catchalls.

  - Ensure that a happens-before relationship is established when
    setting terminate handlers in one thread and calling them in
    another.

MFC r245327 (by theraven):

  Fix libcxxrt / libc++ build with the clang in head.

  Pointy hat to: theraven

MFC r245745 (by theraven):

  Import new fix from libcxxrt.  This fixes the case where you attempt
  to rethrow an exception when you haven't caught one.  This is largely
  a cosmetic fix, as (unless you have a very unusual terminate handler
  installed) it will print a nice error and then abort, rather than
  just aborting.

MFC r246462 (by theraven):

  Fix a copy-and-paste error in libcxxrt.

MFC r249993:

  Merge libcxxrt c812a07cd2f95c1403baf0bbe0366e7618d1d6d3:

  * Don't call the _fast version of the TLS accessor in terminate() or
    unexpected().
    1) TLS may not have been set up yet.
    2) When we're in one of these functions, Really Bad Stuff has
       happened and potentially saving a few cycles really isn't
       important.
  * Merge in fixes from FreeBSD trunk to make atomics work with recent
    clang.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250241 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249983: syslogd: Use closefrom() instead of getdtablesize()/close()
jilles [Sat, 4 May 2013 11:49:02 +0000 (11:49 +0000)]
MFC r249983: syslogd: Use closefrom() instead of getdtablesize()/close()
loop.

When syslogd forks a process for '|' destinations, it closes all file
descriptors greater than 2.

Use closefrom() for this instead of a getdtablesize()/close() loop because
it is both faster and avoids leaving file descriptors open because the limit
was lowered after they were opened.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250232 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r250000:
cperciva [Sat, 4 May 2013 00:31:41 +0000 (00:31 +0000)]
MFC r250000:
  Move IPPROTO_IPV6 from #ifdef __BSD_VISIBLE to #if __POSIX_VISIBLE >= 201112
  since POSIX 2001 states that it shall be defined.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250228 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r244091:
pluknet [Fri, 3 May 2013 15:54:13 +0000 (15:54 +0000)]
MFC r244091:

Improve style(9) compliance of function declarations.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250216 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r228269,228921:
pluknet [Fri, 3 May 2013 15:52:43 +0000 (15:52 +0000)]
MFC r228269,228921:

- libc: Eliminate 13 relative relocations in wctype().
- libc: Eliminate some relative relocations in setlocale().

git-svn-id: svn://svn.freebsd.org/base/stable/9@250215 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r233473,233512,233518,233992,233994,238808,238920,250209-250211.
pluknet [Fri, 3 May 2013 14:59:32 +0000 (14:59 +0000)]
MFC r233473,233512,233518,233992,233994,238808,238920,250209-250211.

libc/locale: sync mdoc changes with head.

 r233473:
  mdoc: document title should be all caps.

 r233512:
  mdoc: remove empty lines.

 r233518:
  mdoc: remove unknown macro.

 r233992:
  mdoc: fix column names, indentation, column separation within each row, and
  quotation. Also make sure we have the same amount of columns in each row as
  the number of columns we specify in the head arguments.

 r233994:
  mdoc: fix function type.

 r238808:
  Start manpage with Dd macro and also remove a trailing whitespace
  while here.

 r238920:
  Remove trailing whitespace.

 r250209:
  querylocale(3): remove the STANDARDS section.

 r250210,r250211:
  Remove an extra comma, add a missing period.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250213 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249489,249555
bdrewery [Thu, 2 May 2013 21:49:43 +0000 (21:49 +0000)]
MFC r249489,249555

  Run configtest before restarting so that the system is not
  left without a running sshd.

  Also call configtest before reload to ensure working config.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250195 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r249548
rmacklem [Thu, 2 May 2013 13:34:40 +0000 (13:34 +0000)]
MFC: r249548
Allow the vnode to be unlocked for the weird case of
LK_EXCLOTHER. LK_EXCLOTHER is only used to acquire a
usecount on a vnode during NFSv4 recovery from an
expired lease.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250178 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r250075:
kib [Thu, 2 May 2013 04:22:04 +0000 (04:22 +0000)]
MFC r250075:
Properly terminate the result string for intermediate results.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250170 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249846:
dim [Wed, 1 May 2013 18:06:53 +0000 (18:06 +0000)]
MFC r249846:

When rebooting (exiting) from the BTX loader, make sure to restore the
GDT from the correct segment, otherwise a triple fault would be caused.
In some virtual environments (VMware, VirtualBox, etc) this could lead
to a unhandled error or hang in the guest emulation software.

Thanks to avg and jhb for a few hints in the right direction.

Noticed by: Jeremy Chadwick <jdc@koitsu.org> (and many others)

git-svn-id: svn://svn.freebsd.org/base/stable/9@250151 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r245647 (by kan):
mav [Wed, 1 May 2013 11:10:15 +0000 (11:10 +0000)]
MFC r245647 (by kan):
Do not pretend to have autosense data when no such data is available.

Make umass return an error code if SCSI sense retrieval request
has failed. Make sure scsi_error_action honors SF_NO_RETRY and
SF_NO_RECOVERY in all cases, even if it cannot parse sense bytes.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250144 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r245328:
mav [Wed, 1 May 2013 09:20:13 +0000 (09:20 +0000)]
MFC r245328:
Freeze device queue before returning errors to CAM.  This is required
for proper error recovery, including keeping original request order.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250142 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r245783:
lstewart [Wed, 1 May 2013 08:53:40 +0000 (08:53 +0000)]
MFC r245783:

Simplify and fix a bug in cc_ack_received()'s "are we congestion window limited"
logic (refer to [1] for associated discussion). snd_cwnd and snd_wnd are
unsigned long and on 64 bit hosts, min() will truncate them to 32 bits and could
therefore potentially corrupt the result (although under normal operation,
neither variable should legitmately exceed 32 bits).

[1] http://lists.freebsd.org/pipermail/freebsd-net/2013-January/034297.html

Submitted by: jhb

git-svn-id: svn://svn.freebsd.org/base/stable/9@250140 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r245752,246913,247162,250119
brooks [Tue, 30 Apr 2013 22:13:55 +0000 (22:13 +0000)]
MFC r245752,246913,247162,250119

Replace all known uses of ln in the build process with appropriate
install -l invocations via new INSTALL_LINK and INSTALL_SYMLINK
variables.

Sponsored by: DARPA, AFRL

git-svn-id: svn://svn.freebsd.org/base/stable/9@250121 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249906:
brooks [Tue, 30 Apr 2013 20:15:53 +0000 (20:15 +0000)]
MFC r249906:

Use the system MAKEOBJDIRPREFIX when running make targets in
mergemaster.  This allows bootstrap verions of tools to be used.

Add a note to UPDATING about this change.

This commit is a partial backout of r248531 in that it removes an
accidentally committed change to mergemaster.

Discussed with: jhb
Sponsored by: DARPA, AFRL

git-svn-id: svn://svn.freebsd.org/base/stable/9@250118 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoImprove error handling when unwrapping received data.
gnn [Tue, 30 Apr 2013 18:06:43 +0000 (18:06 +0000)]
Improve error handling when unwrapping received data.

Submitted by: Rick Macklem

git-svn-id: svn://svn.freebsd.org/base/stable/9@250111 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249858:
mm [Tue, 30 Apr 2013 10:05:47 +0000 (10:05 +0000)]
MFC r249858:
Merge vendor bugfix for a possible deadlock related to async destroy
and improve write performance by introducing a new lock protecting
tx_open_txg.

Illumos ZFS issues:
  3642 dsl_scan_active() should not issue I/O to determine if async
       destroying is active
  3643 txg_delay should not hold the tc_lock

git-svn-id: svn://svn.freebsd.org/base/stable/9@250098 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC of 249789:
mckusick [Tue, 30 Apr 2013 06:41:42 +0000 (06:41 +0000)]
MFC of 249789:

Fix error check.

Submitted by: Andrey Chernov (ache@)

git-svn-id: svn://svn.freebsd.org/base/stable/9@250094 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249996:
eadler [Tue, 30 Apr 2013 00:49:25 +0000 (00:49 +0000)]
MFC r249996:
Add missing static qualifiers

git-svn-id: svn://svn.freebsd.org/base/stable/9@250084 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r248478
jkim [Mon, 29 Apr 2013 21:49:22 +0000 (21:49 +0000)]
MFC: r248478

Add preliminary support for IBM/Lenovo TrackPoint.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250078 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r243314:
pluknet [Mon, 29 Apr 2013 21:30:04 +0000 (21:30 +0000)]
MFC r243314:
 Zero the whole struct not just the size of a pointer.

MFC r246670:
 Major update for unix_cmsg.

PR: bin/131567
Submitted by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>

git-svn-id: svn://svn.freebsd.org/base/stable/9@250076 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r246826:
pluknet [Mon, 29 Apr 2013 21:11:21 +0000 (21:11 +0000)]
MFC r246826:
 Add support of passing SCM_BINTIME ancillary data object for PF_LOCAL
 sockets.

PR: kern/175883
Submitted by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>

git-svn-id: svn://svn.freebsd.org/base/stable/9@250072 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoFix a bug that allows NFS clients to issue READDIR on files.
des [Mon, 29 Apr 2013 21:11:01 +0000 (21:11 +0000)]
Fix a bug that allows NFS clients to issue READDIR on files.

(files missing from previous commit)

PR: kern/178016
Security: CVE-2013-3266
Security: FreeBSD-SA-13:05.nfsserver
Approved by: so

git-svn-id: svn://svn.freebsd.org/base/stable/9@250070 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r248777
jkim [Mon, 29 Apr 2013 21:04:37 +0000 (21:04 +0000)]
MFC: r248777

Loosen restrictions for quoted strings.  Now we can use more complex strings
and "escaped" quote characters.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250066 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r248253:
pluknet [Mon, 29 Apr 2013 20:30:29 +0000 (20:30 +0000)]
MFC r248253:
 Add missed `_load' to the `if_foo_load="YES"' line.

PR: docs/176915
Submitted by: Dmitry Afanasiev <KOT@MATPOCKuH.Ru>

git-svn-id: svn://svn.freebsd.org/base/stable/9@250063 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoFix a bug that allows NFS clients to issue READDIR on files.
des [Mon, 29 Apr 2013 20:15:55 +0000 (20:15 +0000)]
Fix a bug that allows NFS clients to issue READDIR on files.

PR: kern/178016
Security: CVE-2013-3266
Security: FreeBSD-SA-13:05.nfsserver
Approved by: so

git-svn-id: svn://svn.freebsd.org/base/stable/9@250060 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoFix build.
pluknet [Mon, 29 Apr 2013 11:35:52 +0000 (11:35 +0000)]
Fix build.
- pass a format string to printf
- catch up with constifying uz_name

git-svn-id: svn://svn.freebsd.org/base/stable/9@250045 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249294:
ae [Mon, 29 Apr 2013 10:52:45 +0000 (10:52 +0000)]
MFC r249294:
  Use IP6STAT_INC/IP6STAT_DEC macros to update ip6 stats.

MFC r249528,249546:
  Add accounting to the source address selection algorithm for cases, when
  it fails to select an address, also add several another counters to
  the statistics.

MFC r249543,249552:
  Replace hardcoded numbers.

MFC r249544:
  Use IP6S_M2MMAX macro.

MFC r249545:
  Replace hardcoded numbers. Also use interface-local scope name instead
  of node-local.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250044 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249719:
ae [Mon, 29 Apr 2013 10:20:46 +0000 (10:20 +0000)]
MFC r249719:
  Since we didn't break the loop, we should set i to -1 to start from the
  beginning.

  Submitted by: Steven Hartland

git-svn-id: svn://svn.freebsd.org/base/stable/9@250043 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249525:
kib [Mon, 29 Apr 2013 06:54:01 +0000 (06:54 +0000)]
MFC r249525:
Rewrite origin_subst_one() to get rid of the wrong limit on the length
of the resulting string.

git-svn-id: svn://svn.freebsd.org/base/stable/9@250040 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r249069
hiren [Mon, 29 Apr 2013 04:38:43 +0000 (04:38 +0000)]
MFC: r249069
Trailing whitespace cleanup along with 80 column enforcemnt.
MFC: r249428
Cosmetic change: Fix a comment reference for Ivy Bridge *Xeon*
MFC: r249460
Improve/correct a comment. We now support a lot more cpu types.

Approved by: sbruno (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@250038 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249883:
mm [Sun, 28 Apr 2013 07:48:53 +0000 (07:48 +0000)]
MFC r249883:
Respect the enoent_ok flag if reporting error for holding an non-existing
snapshot.

Related illumos ZFS issue:
  3699 zfs hold or release of a non-existent snapshot does not output error

Reported by: Steven Hartland <smh@FreeBSD.org>

git-svn-id: svn://svn.freebsd.org/base/stable/9@250016 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMerge r249903 from head:
glebius [Sat, 27 Apr 2013 07:00:31 +0000 (07:00 +0000)]
Merge r249903 from head:
  Fix couple of mbuf leaks in incoming ARP processing.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249975 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249849:
mav [Sat, 27 Apr 2013 06:09:13 +0000 (06:09 +0000)]
MFC r249849:
Move hptmv and mpt drivers shutdown a bit later to the SHUTDOWN_PRI_LAST
stage of shutdown_post_sync.  That should allow CAM to do final cache flush
at the SHUTDOWN_PRI_DEFAULT without using polling magic.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249972 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r248783
bryanv [Sat, 27 Apr 2013 01:48:09 +0000 (01:48 +0000)]
MFC r248783

Add missing space

git-svn-id: svn://svn.freebsd.org/base/stable/9@249964 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249233: mqueue,ksem,shm: Fix race condition with setting UF_EXCLOSE.
jilles [Fri, 26 Apr 2013 21:07:27 +0000 (21:07 +0000)]
MFC r249233: mqueue,ksem,shm: Fix race condition with setting UF_EXCLOSE.

POSIX mqueue, compatibility ksem and POSIX shm create a file descriptor that
has close-on-exec set. However, they do this incorrectly, leaving a window
where a thread may fork and exec while the flag has not been set yet. The
race is easily reproduced on a multicore system with one thread doing
shm_open and close and another thread doing posix_spawnp and waitpid.

Set UF_EXCLOSE via falloc()'s flags argument instead. This also simplifies
the code.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249953 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r248803: btowc(3), isblank(3): Correct prototypes for _l variants.
jilles [Fri, 26 Apr 2013 16:09:10 +0000 (16:09 +0000)]
MFC r248803: btowc(3), isblank(3): Correct prototypes for _l variants.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249936 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249471: libc: Fix typo in French translation.
jilles [Fri, 26 Apr 2013 16:05:43 +0000 (16:05 +0000)]
MFC r249471: libc: Fix typo in French translation.

PR: kern/177704
Submitted by: martymac

git-svn-id: svn://svn.freebsd.org/base/stable/9@249935 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC remainder of r249802 (eadler) to fix build:
gjb [Fri, 26 Apr 2013 11:57:05 +0000 (11:57 +0000)]
MFC remainder of r249802 (eadler) to fix build:

- sl_find does not modify 'name'
- make the prototype of sl_find match NetBSD

git-svn-id: svn://svn.freebsd.org/base/stable/9@249922 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249787:
mm [Fri, 26 Apr 2013 07:00:49 +0000 (07:00 +0000)]
MFC r249787:
The zfs synctask code restructuring introduced a new bug that makes it
impossible to set quota and reservation on pools lower than version 22.
Problem has been reported and a solution discussed with vendor.

Illumos ZFS issues:
  3739 cannot set zfs quota or reservation on pool version < 22

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reported by: Steve Wills <swills@FreeBSD.org>

git-svn-id: svn://svn.freebsd.org/base/stable/9@249920 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249631
ache [Fri, 26 Apr 2013 01:56:58 +0000 (01:56 +0000)]
MFC r249631

Attempt to mitigate poor initialization of arc4 by one-shot
reinitialization from yarrow right after good entropy is harvested.

Approved by:    secteam (delphij)

git-svn-id: svn://svn.freebsd.org/base/stable/9@249915 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249802:
eadler [Fri, 26 Apr 2013 00:47:22 +0000 (00:47 +0000)]
MFC r249802:
- sl_find does not modify 'name'
- make the prototype of sl_find match NetBSD

git-svn-id: svn://svn.freebsd.org/base/stable/9@249912 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249801:
eadler [Fri, 26 Apr 2013 00:45:00 +0000 (00:45 +0000)]
MFC r249801:
Switch from K&R prototypes to modern C

git-svn-id: svn://svn.freebsd.org/base/stable/9@249910 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249349
sbruno [Thu, 25 Apr 2013 17:02:22 +0000 (17:02 +0000)]
MFC r249349

Repair camcontrol output and use CAM defined values for string sizes

git-svn-id: svn://svn.freebsd.org/base/stable/9@249898 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC of r249848
rrs [Thu, 25 Apr 2013 11:25:24 +0000 (11:25 +0000)]
MFC of r249848

PR: 174749, 157796

git-svn-id: svn://svn.freebsd.org/base/stable/9@249892 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoRecord sendmail 8.14.7 upgrade
gshapiro [Thu, 25 Apr 2013 02:24:24 +0000 (02:24 +0000)]
Record sendmail 8.14.7 upgrade

git-svn-id: svn://svn.freebsd.org/base/stable/9@249875 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: Minor changes to force commit these files so new freebsd*.cf files are
gshapiro [Thu, 25 Apr 2013 01:46:20 +0000 (01:46 +0000)]
MFC: Minor changes to force commit these files so new freebsd*.cf files are
     built to use the new sendmail-8.14.7/cf tree.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249867 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: Update for sendmail 8.14.7
gshapiro [Thu, 25 Apr 2013 01:44:00 +0000 (01:44 +0000)]
MFC: Update for sendmail 8.14.7

git-svn-id: svn://svn.freebsd.org/base/stable/9@249866 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: Merge sendmail 8.14.7
gshapiro [Thu, 25 Apr 2013 01:42:54 +0000 (01:42 +0000)]
MFC: Merge sendmail 8.14.7

git-svn-id: svn://svn.freebsd.org/base/stable/9@249865 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r248690, r248706, 248708, r248752:
pfg [Wed, 24 Apr 2013 20:10:52 +0000 (20:10 +0000)]
MFC r248690, r248706, 248708, r248752:
Dtrace: merge new functions from Illumos.

This covers illumos issues:

1455 DTrace tracemem() should take an optional size argument
1451 DTrace needs toupper()/tolower() subroutines
1457 lltostr() D subroutine should take an optional base
1694 Add type-aware print() action
3511 dtrace.c erroneously checks for memory alignment on amd64

This includes an enhanced print() described here:

http://dtrace.org/blogs/eschrock/2011/10/26/your-mdb-fell-into-my-dtrace/

This change bumps the DT_VERS_* number to 1.9.0 in
accordance to what is done in illumos.

Illumos Revisions: 13457:571b0355c2e3
13458:5e394d8db762
13459:c3454574dd1a
13501:c3a7090dbc16
13483:f413e6c5d297

Reference:
https://www.illumos.org/issues/1455
https://www.illumos.org/issues/1451
https://www.illumos.org/issues/1457
https://www.illumos.org/issues/1560
https://www.illumos.org/issues/1694
https://www.illumos.org/issues/3511

Tested by: Fabian Keil
Obtained from: Illumos

git-svn-id: svn://svn.freebsd.org/base/stable/9@249856 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249346:
mav [Wed, 24 Apr 2013 19:36:40 +0000 (19:36 +0000)]
MFC r249346:
Create controller-level DMA tag, handling range of supported addresses.
That simplifies logic for channels and gives the bus information about what
device actually allocated the tag.

Submitted by: jhb

git-svn-id: svn://svn.freebsd.org/base/stable/9@249853 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r248704:
mav [Wed, 24 Apr 2013 19:33:37 +0000 (19:33 +0000)]
MFC r248704:
Read Asynchronous Notification statuses only if Port Multiplier or ATAPI
device are connected. ATA disks are not using ANs, while the extra register
read operation is quite expensive.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249852 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r248698:
mav [Wed, 24 Apr 2013 19:24:53 +0000 (19:24 +0000)]
MFC r248698:
Depending on combination of running commands (NCQ/non-NCQ) try to avoid
extra read from PxCI/PxSACT registers.  If only NCQ commands are running, we
don't really need PxCI.  If only non-NCQ commands are running we don't need
PxSACT.  Mixed set may happen only on controllers with FIS-based switching
when port multiplier is attached, and then we have to read both registers.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249851 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r248687:
mav [Wed, 24 Apr 2013 19:22:19 +0000 (19:22 +0000)]
MFC r248687:
No need to erase all 64 bytes of CFIS area if we never use more then 16.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249850 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r227101:
eadler [Wed, 24 Apr 2013 12:47:30 +0000 (12:47 +0000)]
MFC r227101:
Add static keywords to variables and functions where possible in games/.

This allows us to detect unused functions and variables and allows the
compiler to do a better job at optimisation.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249840 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249281: Add FreeBSD 8.4.
pluknet [Wed, 24 Apr 2013 10:18:56 +0000 (10:18 +0000)]
MFC r249281: Add FreeBSD 8.4.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249835 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMerge unmerged commits to fortune(1)
eadler [Wed, 24 Apr 2013 04:21:19 +0000 (04:21 +0000)]
Merge unmerged commits to fortune(1)

git-svn-id: svn://svn.freebsd.org/base/stable/9@249828 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoUpdate error messages when processing the INDEX file to display the given
dteske [Tue, 23 Apr 2013 22:45:03 +0000 (22:45 +0000)]
Update error messages when processing the INDEX file to display the given
path rather than a static string. This makes the error messages consistent
with the rest of the functions which already do the same thing (assumed to
be an oversight or r47055, 13+ years ago). A direct commit to stable/9.

Reviewed by: eadler
MFC after: 3 days

git-svn-id: svn://svn.freebsd.org/base/stable/9@249822 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMerge checked by: Glen Barber (gjb@)
mckusick [Tue, 23 Apr 2013 06:28:49 +0000 (06:28 +0000)]
Merge checked by: Glen Barber (gjb@)

MFC of 247212:
When running with the -d option, instrument fsck_ffs to track the number,
data type, and running time of its I/O operations.

No functional changes.

MFC of 247234:
Catch up with internal API changes for initbarea() and getdatablk()
of fsck_ffs introduced with r247212.

Submitted by:   David Wolfskill <david@catwhisker.org>

MFC of 248625:
Speed up fsck by caching the cylinder group maps in pass1 so
that they do not need to be read again in pass5. As this nearly
doubles the memory requirement for fsck, the cache is thrown away
if other memory needs in fsck would otherwise fail. Thus, the
memory footprint of fsck remains unchanged in memory constrained
environments.

This work was inspired by a paper presented at Usenix's FAST '13:
www.usenix.org/conference/fast13/ffsck-fast-file-system-checker

Details of this implementation appears in the April 2013 of ;login:
www.usenix.org/publications/login/april-2013-volume-38-number-2.
A copy of the April 2013 ;login: paper can also be downloaded
from: www.mckusick.com/publications/faster_fsck.pdf.

Reviewed by: kib
Tested by:   Peter Holm

MFC of 248639:
Fix the build after addition of cylinder group cacheing (r248625)

Reported by:   Glen Barber (gjb@)
Pointy hat to: Kirk McKusick (mckusick@)

MFC of 248673:
Minor formatting fix for printf() to fix clang builds.

Submitted by:   db
Reviewed by:    gjb

MFC of 248680:
Resolve clang compile errors on amd64/i386 for certain by casting.

compile tested with clang on i386, amd64
compile tested with gcc on i386, amd64, sparc64

Submitted by:   delphij

MFC of 248691:
Note that output is in seconds, not msec.
KNF indentation.
No functional change.
No change to printf strings.
No change to casting of printf arguments.

Reported by: Bruce Evans

git-svn-id: svn://svn.freebsd.org/base/stable/9@249788 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC of 248623:
mckusick [Tue, 23 Apr 2013 01:09:22 +0000 (01:09 +0000)]
MFC of 248623:

The purpose of this change to the FFS layout policy is to reduce the
running time for a full fsck. It also reduces the random access time
for large files and speeds the traversal time for directory tree walks.

The key idea is to reserve a small area in each cylinder group
immediately following the inode blocks for the use of metadata,
specifically indirect blocks and directory contents. The new policy
is to preferentially place metadata in the metadata area and
everything else in the blocks that follow the metadata area.

The size of this area can be set when creating a filesystem using
newfs(8) or changed in an existing filesystem using tunefs(8).
Both utilities use the `-k held-for-metadata-blocks' option to
specify the amount of space to be held for metadata blocks in each
cylinder group. By default, newfs(8) sets this area to half of
minfree (typically 4% of the data area).

This work was inspired by a paper presented at Usenix's FAST '13:
www.usenix.org/conference/fast13/ffsck-fast-file-system-checker

Details of this implementation appears in the April 2013 of ;login:
www.usenix.org/publications/login/april-2013-volume-38-number-2.
A copy of the April 2013 ;login: paper can also be downloaded
from: www.mckusick.com/publications/faster_fsck.pdf.

Reviewed by: kib
Tested by:   Peter Holm

git-svn-id: svn://svn.freebsd.org/base/stable/9@249785 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC of 242520:
mckusick [Mon, 22 Apr 2013 23:59:00 +0000 (23:59 +0000)]
MFC of 242520:

When a file is first being written, the dynamic block reallocation
(implemented by ffs_reallocblks_ufs[12]) relocates the file's blocks
so as to cluster them together into a contiguous set of blocks on
the disk.

When the cluster crosses the boundary into the first indirect block,
the first indirect block is initially allocated in a position
immediately following the last direct block.  Block reallocation
would usually destroy locality by moving the indirect block out of
the way to keep the data blocks contiguous.  This change compensates
for this problem by noting that the first indirect block should be
left immediately following the last direct block.  It then tries
to start a new cluster of contiguous blocks (referenced by the
indirect block) immediately following the indirect block.

We should also do this for other indirect block boundaries, but it
is only important for the first one.

Suggested by: Bruce Evans

MFC of 248623:

The purpose of this change to the FFS layout policy is to reduce the
running time for a full fsck. It also reduces the random access time
for large files and speeds the traversal time for directory tree walks.

The key idea is to reserve a small area in each cylinder group
immediately following the inode blocks for the use of metadata,
specifically indirect blocks and directory contents. The new policy
is to preferentially place metadata in the metadata area and
everything else in the blocks that follow the metadata area.

The size of this area can be set when creating a filesystem using
newfs(8) or changed in an existing filesystem using tunefs(8).
Both utilities use the `-k held-for-metadata-blocks' option to
specify the amount of space to be held for metadata blocks in each
cylinder group. By default, newfs(8) sets this area to half of
minfree (typically 4% of the data area).

This work was inspired by a paper presented at Usenix's FAST '13:
www.usenix.org/conference/fast13/ffsck-fast-file-system-checker

Details of this implementation appears in the April 2013 of ;login:
www.usenix.org/publications/login/april-2013-volume-38-number-2.
A copy of the April 2013 ;login: paper can also be downloaded
from: www.mckusick.com/publications/faster_fsck.pdf.

Reviewed by: kib
Tested by:   Peter Holm

git-svn-id: svn://svn.freebsd.org/base/stable/9@249782 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249398:
ae [Mon, 22 Apr 2013 06:47:05 +0000 (06:47 +0000)]
MFC r249398:
  Free memory after deleting an address policy entry.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249760 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249238, r249239:
trociny [Sun, 21 Apr 2013 17:14:50 +0000 (17:14 +0000)]
MFC r249238, r249239:

r249238:

Use 4-byte padding for core dump notes on both 32 and 64bit archs.

Although native word padding (i.e. 8-byte on 64bit arch) looks to be
in agreement with standards, other parts of our code and other OSes
use 4-byte alignment.

This is not expected to change alignment for currently generated core
dump notes, as the notes look to consist of structures with sizes
multiple of 8 on 64-bit archs. But there are plans to add additional
notes, where 4-byte vs 8-byte alignment makes difference.

Discussed with: kib
Reviewed by: kib

r249239:

Fill p_flags and p_align fields of the core dump note segement.

Reviewed by: kib

git-svn-id: svn://svn.freebsd.org/base/stable/9@249734 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249476:
kib [Sun, 21 Apr 2013 12:16:59 +0000 (12:16 +0000)]
MFC r249476:
Esnure that PCI bus BUS_GET_DMA_TAG() method sees the actual PCI device
which makes the request for dma tag, instead of some descendant of
the PCI device, by creating a pass-through trampoline for vga_pci and
ata_pci buses.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249723 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agolibstdc++: Revert the expl addition from r246857.
pfg [Sat, 20 Apr 2013 14:55:48 +0000 (14:55 +0000)]
libstdc++: Revert the expl addition from r246857.

When the needed configuration update to libstdc++ was done.
we overlooked  that expl hasn't been merged. This is causing
breakage in  some ports.

Reported by: Diane Bruce
Reviewed by: dim

git-svn-id: svn://svn.freebsd.org/base/stable/9@249703 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMerge of current from 249692, tzdata2013c:
edwin [Sat, 20 Apr 2013 11:46:38 +0000 (11:46 +0000)]
Merge of current from 249692, tzdata2013c:

- antarctica: AusAQ and ATAQ have been removed.
- Antarctica/Macquarie has been moved to australasia file and AU.
- Asia/Hebron, Palestine updated for 2013.
- Paraguay stays with DST for the whole year.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249696 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249047 (avg):
mm [Sat, 20 Apr 2013 09:25:25 +0000 (09:25 +0000)]
MFC r249047 (avg):
spa_open_common: fix argument to zvol_create_minors

Prior to r248571 spa_open was always called with a bare pool name,
but now it is called with a dataset name instead (spa_lookup handles
that).
So, when a ZFS root is mounted spa_open is called with a name of a root
dataset, which can very well be different from the pool name.
But zvol_create_minors should be called with the pool name, because it
performs a recursive traversal of all datasets under the name to find
all those that are volumes.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249689 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249347:
ken [Fri, 19 Apr 2013 21:09:27 +0000 (21:09 +0000)]
MFC r249347:
  ------------------------------------------------------------------------
  r249347 | ken | 2013-04-10 16:12:21 -0600 (Wed, 10 Apr 2013) | 22 lines

  Add a callback to the ada(4) driver so that it knows when GEOM has released
  references to it.

  This is the functional equivalent to change r237518, which added this
  functionality to the cd(4) and da(4) drivers.

  This fix prevents a panic caused by GEOM calling adaopen() while the device
  is going away.  We now keep the device around until GEOM has finished
  cleaning up its state.

  ata_da.c: In adaregister(), add a d_gone callback to the GEOM disk
structure registered for the ada driver.  Increment the
peripheral reference count for GEOM.

Add a new callback, adadiskgonecb(), that GEOM calls when
it is done with its resources.  This callback releases the
reference acquired in adaregister().

Submitted by: Po-Li Soong
Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/9@249661 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r248842
hiren [Fri, 19 Apr 2013 19:28:48 +0000 (19:28 +0000)]
MFC: r248842

Update hwpmc to support Haswell class processors.
0x3C:      /* Per Intel document 325462-045US 01/2013. */

Add manpage to document all the goodness that is available in this
processor model.

Approved by: sbruno (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@249655 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 248571,248976,249004,249042,249188,249195-249196,249206,249207,249319,
mm [Fri, 19 Apr 2013 09:19:10 +0000 (09:19 +0000)]
MFC 248571,248976,249004,249042,249188,249195-249196,249206,249207,249319,
    249326,249356-249357

Merge libzfs_core and other ZFS bugfixes and improvements.

MFC r248571:
  MFV 238590, 238592:
  In the first zfs ioctl restructuring phase, the libzfs_core library was
  introduced. It is a new thin library that wraps around kernel ioctl's.
  The idea is to provide a forward-compatible way of dealing with new
  features. Arguments are passed in nvlists and not random zfs_cmd fields,
  new-style ioctls are logged to pool history using a new method of
  history logging.

  http://blog.delphix.com/matt/2012/01/17/the-future-of-libzfs/

  MFV 247580 [1]:
  To address issues of several deadlocks and race conditions the locking
  code around dsl_dataset was rewritten and the interface to synctasks
  was changed.

  User-Visible Changes:
  "zfs snapshot" can create more arbitrary snapshots at once (atomically)
  "zfs destroy" destroys multiple snapshots at once
  "zfs recv" has improved performance

  Backward Compatibility:
  I have extended the compatibility layer to support full backward
  compatibility by remapping or rewriting the responsible ioctl arguments.
  Old utilities are fully supported by the new kernel module.

  Forward Compatibility:
  New utilities work with old kernels with the following restrictions:
    - creating, destroying, holding and releasing of multiple snapshots
      at once is not supported, this includes recursive (-r) commands

  Illumos ZFS issues:
    2882 implement libzfs_core
    2900 "zfs snapshot" should be able to create multiple,
         arbitrary snapshots at once
    3464 zfs synctask code needs restructuring

MFC r248976:
  Call dmu_snapshot_list_next() in zvol.c with dsl_pool_config lock held

MFC r249004:
  Do not check against uninitialized rc and comment out vendor code

MFC r249042:
  Fix possible pool hold leak in dmu_send_impl()

  Illumos ZFS issues:
    3645 dmu_send_impl: possibilty of pool hold leak

MFC r249188:
  Import vendor change to reduce diff, no effect on FreeBSD.

  Illumos ZFS issues:
    3517 importing pool with autoreplace=on and "hole" vdevs crashes
 syseventd

MFC r249195:
  Merge change from vendor to reduce diff only.
  ZFS dtrace probes are not supported on FreeBSD yet.

  Illumos ZFS issues:
    3598 want to dtrace when errors are generated in zfs

MFC r249196:
  Provide a fix for kernel panic if receiving recursive deduplicated
  streams. Problem reported to vendor.

  Illumos ZFS issues:
    3692 Panic on zfs receive of a recursive deduplicated stream

MFC r249206:
  Merge vendor change - modify time processing in deadman thread.

  Illumos ZFS issues:
    3618 ::zio dcmd does not show timestamp data

MFC r249207:
  Allow zdb to output a histogram of compressed block sizes.

  Illumos ZFS issues:
    3641 want a histogram of compressed block sizes

MFC r249319:
  ZFS expects a copyout of zfs_cmd_t on an ioctl error. Our sys_ioctl()
  doesn't copyout in this case.

  To solve this a new struct zfs_iocparm_t is introduced consisting of:
  - zfs_ioctl_version (future backwards compatibility purposes)
  - user space pointer to zfs_cmd_t (copyin and copyout)
  - size of zfs_cmd_t (verification purposes)

  The copyin and copyout of zfs_cmd_t is now done the illumos (vendor) way
  what makes porting of new changes easier and ensures correct behavior if
  returning an error.

MFC r249326:
  Cast (void *)(uintptr_t) on copyout and copyin of zfs_iocparm_t.zfs_cmd

MFC r249356:
  Merge bugfixes accepted and integrated by vendor. Underlying problems
  have been reported by us and fixed in r240942 and r249196.

  Illumos ZFS issues:
    3645 dmu_send_impl: possibilty of pool hold leak
    3692 Panic on zfs receive of a recursive deduplicated stream

MFC r249357:
  Fix libzfs to report error instead of returning zero if trying to hold or
  release a non-existing snapshot of a existing dataset. In recursive case
  error is reported if no snapshots with the requested name have been found.

  Illumos ZFS issues:
    3699 zfs hold or release of a non-existent snapshot does not output
 error

git-svn-id: svn://svn.freebsd.org/base/stable/9@249643 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249170
sbruno [Fri, 19 Apr 2013 05:28:08 +0000 (05:28 +0000)]
MFC r249170

Notify CAM on state* change to a logical volume not status.  This resolves
the issues reported regarding camcontrol devlist not showing the rebuild
states of volumes unless an explicit camcontrol rescan was executed.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249635 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249334 and r249384:
ken [Fri, 19 Apr 2013 03:55:54 +0000 (03:55 +0000)]
MFC r249334 and r249384:

  ------------------------------------------------------------------------
  r249334 | ken | 2013-04-10 10:01:45 -0600 (Wed, 10 Apr 2013) | 11 lines

  Fix a time calculation error in ctlstat_standard().

  ctlstat.c: When converting a timeval to a floating point
number in ctlstat_standard(), cast the nanoseconds
calculation to a long double, so we don't lose
precision.  Without the cast, we wind up with a
time in whole seconds only.

  Sponsored by:   Spectra Logic
  ------------------------------------------------------------------------
  r249384 | ken | 2013-04-11 15:18:04 -0600 (Thu, 11 Apr 2013) | 17 lines

  Fix bugs in the elapsed time calculation in ctlstat_standard()
  pointed out by bde:

  - Casting to long double isn't needed.
  - The division isn't needed, multiplication can be used.
    "When 1 nanosecond is in a floating point literal, the whole
    expression is automatically promoted correctly."
  - non-KNF indentation (1 tab) for the newly split line
  - different non-KNF indentation (5 spaces) for the previously split
    line
  - exessive parentheses around the division operation
  - bogus blank line which splits up the etime initialization
  - general verboseness from the above.

  Submitted by:   bde

Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/9@249632 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249336:
mav [Thu, 18 Apr 2013 13:19:41 +0000 (13:19 +0000)]
MFC r249336:
Add ID for ASMedia ASM1042 USB 3.0 controller.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249624 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r248694:
mav [Thu, 18 Apr 2013 11:13:48 +0000 (11:13 +0000)]
MFC r248694:
In GEOM DISK:
 - Replace single done mutex with per-disk ones.  On system with several
disks on several HBAs that removes small, but measurable lock congestion.
 - Modify disk destruction process to not destroy the mutex prematurely.
 - Remove some extra pointer derefences.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249621 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238171, r248679:
mav [Thu, 18 Apr 2013 10:57:56 +0000 (10:57 +0000)]
MFC r238171, r248679:
Fix long known deadlock between geom dev destruction and d_close() call.
Use destroy_dev_sched_cb() to not wait for device destruction while holding
GEOM topology lock (that actually caused deadlock).  Use request counting
protected by mutex to properly wait for outstanding requests completion in
cases of device closing and geom destruction.  Unlike r227009, this code
does not block taskqueue thread for indefinite time, waiting for completion.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249620 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r248674:
mav [Thu, 18 Apr 2013 10:49:52 +0000 (10:49 +0000)]
MFC r248674:
Make g_wither_washer() to not loop by itself, but only when there was some
more topology change done that may require its attention.  Add few missing
g_do_wither() calls in respective places to signal it.

This fixes potential infinite loop here when some provider is withered, but
still opened or connected for some reason and so can not be destroyed.  For
example, see r227009 and r227510.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249619 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249224:
mav [Thu, 18 Apr 2013 10:42:48 +0000 (10:42 +0000)]
MFC r249224:
Remove extra semicolons from CAM_SIM_[UN]LOCK() macros.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249618 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249108:
mav [Thu, 18 Apr 2013 10:40:40 +0000 (10:40 +0000)]
MFC r249108:
 - Unify device to target insertion inside xpt_alloc_device() instead of
duplicating it three times.
 - Reformat code to reduce indentation.
 - Add lock assertions to every point where reference counters are modified.
 - When reference counters are reaching zero, add assertions that there are
no children items left.
 - Add a bit more locking to the xptpdperiphtraverse().

git-svn-id: svn://svn.freebsd.org/base/stable/9@249617 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249106:
mav [Thu, 18 Apr 2013 10:06:52 +0000 (10:06 +0000)]
MFC r249106:
Replace some direct mutex operations with wrappers.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249615 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249105:
mav [Thu, 18 Apr 2013 10:03:44 +0000 (10:03 +0000)]
MFC r249105:
Remove extra NULL checks. d_drv1 can never be NULL during periph life cycle.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249614 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249104:
mav [Thu, 18 Apr 2013 10:01:43 +0000 (10:01 +0000)]
MFC r249104:
Move CAM_DEBUG_CDB messages from the point of queuing to the point of
sending to SIM.  That allows to inspect real requests execution order,
respecting priorities, freezing, etc.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249613 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249091:
mav [Thu, 18 Apr 2013 09:58:30 +0000 (09:58 +0000)]
MFC r249091:
Use xpt_lock_buses() instead of equivalent mtx_lock(&xsoftc.xpt_topo_lock)
to unify the code.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249612 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r248872, r249048:
mav [Thu, 18 Apr 2013 09:44:00 +0000 (09:44 +0000)]
MFC r248872, r249048:
Make pre-shutdown flush and spindown routines to not use xpt_polled_action(),
but execute the commands in regular way.  There is no any reason to cook CPU
while the system is still fully operational.  After this change polling in
CAM is used only for kernel dumping.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249611 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r248868, r248874:
mav [Thu, 18 Apr 2013 09:40:34 +0000 (09:40 +0000)]
MFC r248868, r248874:
Implement CAM_PERIPH_FOREACH() macro, safely iterating over the list of
driver's periphs, acquiring and releaseing periph references while doing it.

Use it to iterate over the lists of ada and da periphs when flushing caches
and putting devices to sleep on shutdown and suspend.  Previous code could
panic in theory if some device disappear in the middle of the process.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249610 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r248695:
mav [Thu, 18 Apr 2013 09:03:06 +0000 (09:03 +0000)]
MFC r248695:
Remove two bzero()s that are erasing only few more bytes then set later.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249609 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC of 248561:
mckusick [Thu, 18 Apr 2013 00:53:47 +0000 (00:53 +0000)]
MFC of 248561:

When renaming a directory from one parent directory to another,
we need to call ufs_checkpath() to walk from our new location to
the root of the filesystem to ensure that we do not encounter
ourselves along the way. Until now, we accomplished this by reading
the ".." entries of each directory in our path until we reached
the root (or encountered an error). This change tries to avoid the
I/O of reading the ".." entries by first looking them up in the
name cache and only doing the I/O when the name cache lookup fails.

Reviewed by: kib
Tested by:   Peter Holm

git-svn-id: svn://svn.freebsd.org/base/stable/9@249599 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC of 249064:
mckusick [Thu, 18 Apr 2013 00:12:32 +0000 (00:12 +0000)]
MFC of 249064:

The code in clear_remove() and clear_inodedeps() skips one entry
in the pagedep and inodedep hash tables. An entry in the table is
skipped because 'pagedep_hash' and 'inodedep_hash' hold the size
of the hash tables - 1.

The chance that this would have any operational failure is extremely
unlikely. These funtions only need to find a single entry and are
only called when there are too many entries. The chance that they
would fail because all the entries are on the single skipped hash
chain are remote.

Submitted by: Pedro Martelletto
Reviewed by:  kib

git-svn-id: svn://svn.freebsd.org/base/stable/9@249597 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r248303:
brooks [Tue, 16 Apr 2013 19:28:00 +0000 (19:28 +0000)]
MFC r248303:

Replace our (un)vis(1) commands with implementations from NetBSD to
match our import of the (un)vis(3) APIs.

This adds support for multibyte encoding and the -h and -m flags which
support HTTP and MIME encoding respectively.

PR: bin/175418
Obtained from: NetBSD

git-svn-id: svn://svn.freebsd.org/base/stable/9@249561 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r248302:
brooks [Tue, 16 Apr 2013 19:27:09 +0000 (19:27 +0000)]
MFC r248302:

Update to the latest (un)vis(3) sources from NetBSD.  This adds
multibyte support[0] and the new functions strenvisx and strsenvisx.

Add MLINKS for vis(3) functions add by this and the initial import from
NetBSD[1].

PR: bin/166364, bin/175418
Submitted by: "J.R. Oldroyd" <fbsd@opal.com>[0]
stefanf[1]
Obtained from: NetBSD

git-svn-id: svn://svn.freebsd.org/base/stable/9@249560 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249449:
dim [Tue, 16 Apr 2013 16:35:48 +0000 (16:35 +0000)]
MFC r249449:

Fix undefined behaviour in several gpio_pin_setflags() routines (under
sys/arm and sys/mips), squelching the clang 3.3 warnings about this.

Noticed by: tinderbox and many irate spectators
Submitted by: Luiz Otavio O Souza <loos.br@gmail.com>
PR: kern/177759

git-svn-id: svn://svn.freebsd.org/base/stable/9@249550 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC (much delayed) 234504:
brooks [Tue, 16 Apr 2013 16:09:27 +0000 (16:09 +0000)]
MFC (much delayed) 234504:

Enable DTrace hooks in GENERIC.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249549 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249316:
dim [Tue, 16 Apr 2013 06:51:07 +0000 (06:51 +0000)]
MFC r249316:

Ensure make -j N universe works correctly, by checking for an up-to-date
make before starting the universe targets themselves.  Otherwise, all of
the targets would attempt to build make simultaneously, overwriting each
other's copies of the make object files and executable.  This could lead
to strange errors, for example when partially-written make executables
are invoked.

Also amend r216620, to make the rest of universe wait properly until the
upgrade_checks target is finished, by adding universe_${target}_prologue
to the .ORDER target.  Otherwise, make will be too smart for its own
good, and start building the universe targets simultaneously with the
prologues anyway.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249534 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249439:
kib [Tue, 16 Apr 2013 06:20:35 +0000 (06:20 +0000)]
MFC r249439:
Fix the name of the pcb member in the comments.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249532 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r249303:
kib [Tue, 16 Apr 2013 06:17:15 +0000 (06:17 +0000)]
MFC r249303:
Fix the assertions for the state of the object under the map entry
with the MAP_ENTRY_VN_WRITECNT flag.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249531 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f