]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/log
FreeBSD/stable/9.git
10 years agoMFC r255048:
bdrewery [Fri, 13 Sep 2013 11:57:52 +0000 (11:57 +0000)]
MFC r255048:

  - Fix LOCAL_MTREE so it properly handles multiple files and quotes
    its value into submakes

PR: conf/179466
Submitted by: Garrett Cooper <yaneurabeya@gmail.com>
Sponsored by: EMC / Isilon Storage Division

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

10 years agoMFC r255439:
kib [Fri, 13 Sep 2013 06:07:25 +0000 (06:07 +0000)]
MFC r255439:
Call free() on the pointer returned from malloc().

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

10 years agoMFC r255459:
cperciva [Fri, 13 Sep 2013 00:51:37 +0000 (00:51 +0000)]
MFC r255459:
  Remove documentation describing functionality which geom(4) does not,
  in fact, provide.

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

10 years agoMFC of 254995:
mckusick [Thu, 12 Sep 2013 19:36:04 +0000 (19:36 +0000)]
MFC of 254995:

A performance problem was reported in PR kern/181226:

    I have 25TB Dell PERC 6 RAID5 array. When it becomes almost
    full (10-20GB free), processes which write data to it start
    eating 100% CPU and write speed drops below 1MB/sec (normally
    to gives 400MB/sec). The revision at which it first became
    apparent was http://svnweb.freebsd.org/changeset/base/249782.

The offending change reserved an area in each cylinder group to
store metadata. The new algorithm attempts to save this area for
metadata and allows its use for non-metadata only after all the
data areas have been exhausted. The size of the reserved area
defaults to half of minfree, so the filesystem reports full before
the data area can completely fill. However, in this report, the
filesystem has had minfree reduced to 1% thus forcing the metadata
area to be used for data. As the filesystem approached full, it
had only metadata areas left to allocate. The result was that
every block allocation had to scan summary data for 30,000 cylinder
groups before falling back to searching up to 30,000 metadata areas.

The fix is to give up on saving the metadata areas once the free
space reserve drops below 2%. The effect of this change is to use
the old algorithm of just accepting the first available block that
we find. Since most filesystems use the default 5% minfree, this
will have no effect on their operation. For those that want to push
to the limit, they will get their crappy block placements quickly.

Submitted by:  Dmitry Sivachenko
Fix Tested by: Dmitry Sivachenko
PR:            kern/181226

MFC of 254996:

In looking at block layouts as part of fixing filesystem block
allocations under low free-space conditions (-r254995), determine
that old block-preference search order used before -r249782 worked
a bit better. This change reverts to that block-preference search order.

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

10 years agoMFC r255412:
delphij [Thu, 12 Sep 2013 00:46:32 +0000 (00:46 +0000)]
MFC r255412:

In r243868, the error message buffer errmsg have been changed from
an on-stack array to a pointer and therefore sizeof(errmsg) would
become 4 or 8 bytes depending on the architecture.

Fix this by using ERRMSGL in place of sizeof().

Submitted by: J David <j.david.lists@gmail.com>

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

10 years agoMFC r254330 -- allow users to run SYS_PD mode JBOD with a non-default MAXPHYS
sbruno [Wed, 11 Sep 2013 19:20:53 +0000 (19:20 +0000)]
MFC r254330 -- allow users to run SYS_PD mode JBOD with a non-default MAXPHYS

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

10 years agoMFC r255428:
delphij [Wed, 11 Sep 2013 17:42:35 +0000 (17:42 +0000)]
MFC r255428:

Pass -n (do not emit comments) when saving mtree information for future
mergemaster(8) runs.

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

10 years agoFix the length calculation for the final block of a sendfile(2)
des [Tue, 10 Sep 2013 10:07:21 +0000 (10:07 +0000)]
Fix the length calculation for the final block of a sendfile(2)
transmission which could be tricked into rounding up to the nearest
page size, leaking up to a page of kernel memory.  [13:11]

In IPv6 and NetATM, stop SIOCSIFADDR, SIOCSIFBRDADDR, SIOCSIFDSTADDR
and SIOCSIFNETMASK at the socket layer rather than pass them on to the
link layer without validation or credential checks.  [SA-13:12]

Prevent cross-mount hardlinks between different nullfs mounts of the
same underlying filesystem.  [SA-13:13]

Security: CVE-2013-5666
Security: FreeBSD-SA-13:11.sendfile
Security: CVE-2013-5691
Security: FreeBSD-SA-13:12.ifioctl
Security: CVE-2013-5710
Security: FreeBSD-SA-13:13.nullfs
Approved by: so

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

10 years agoMFC r255320:
delphij [Tue, 10 Sep 2013 00:40:21 +0000 (00:40 +0000)]
MFC r255320:

Return BUS_PROBE_DEFAULT instead of BUS_PROBE_SPECIFIC.

This change is a 9.2-RELEASE candidate.

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

10 years agoMFC r253980 - new pciids for ciss(4) support
sbruno [Mon, 9 Sep 2013 21:25:34 +0000 (21:25 +0000)]
MFC r253980 - new pciids for ciss(4) support

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

10 years agoMFC r254906 -- add SYSPD (real jbod) support to mfiutil
sbruno [Mon, 9 Sep 2013 21:00:03 +0000 (21:00 +0000)]
MFC r254906 -- add SYSPD (real jbod) support to mfiutil

Add support to reconfigure a drive as SYSPD (real JBOD in LSI
terminology).

Adds command "mfiutil syspd <drive#>" to change a drive to SYSPD.  Drive
will then be scanned/reported immediately as /dev/mfisyspdX by the host.

"mfiutil good <drive#>" clears SYSPD mode, remove /dev/mfisyspdX and
sets disk into UNCONFIGURED mode.

Tested on Dell H310 SAS/SATA RAID controller.

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

10 years agoMFC r254776:
trociny [Sun, 8 Sep 2013 17:47:14 +0000 (17:47 +0000)]
MFC r254776:

Make ipfw nat init/unint work correctly for VIMAGE:

* Do per vnet instance cleanup (previously it was only for vnet0 on
  module unload, and led to libalias leaks and possible panics due to
  stale pointer dereferences).

* Instead of protecting ipfw hooks registering/deregistering by only
  vnet0 lock (which does not prevent pointers access from another
  vnets), introduce per vnet ipfw_nat_loaded variable. The variable is
  set after hooks are registered and unset before they are deregistered.

* Devirtualize ifaddr_event_tag as we run only one event handler for
  all vnets.

* It is supposed that ifaddr_change event handler is called in the
  interface vnet context, so add an assertion.

Reviewed by: zec

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

10 years agoMFH (r255243): create /var/authpf with correct ownership and permissions.
des [Sun, 8 Sep 2013 17:28:11 +0000 (17:28 +0000)]
MFH (r255243): create /var/authpf with correct ownership and permissions.

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

10 years agoMFH (r254684, r254955): fix segfault on reload.
des [Sun, 8 Sep 2013 11:35:56 +0000 (11:35 +0000)]
MFH (r254684, r254955): fix segfault on reload.
MFH (r255156): silence an error message on non-IPv6 interfaces.

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

10 years agoMFC r255090 and r255128:
hselasky [Sat, 7 Sep 2013 06:38:34 +0000 (06:38 +0000)]
MFC r255090 and r255128:

PR: kern/181728

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

10 years agoMFC r245428:
dim [Fri, 6 Sep 2013 15:17:25 +0000 (15:17 +0000)]
MFC r245428:

Add CLOCK_PROCESS_CPUTIME_ID to <time.h>, to synchronize the CLOCK_*
values with those in <sys/time.h>.  Otherwise, if a program includes
<time.h> before <sys/time.h>, the CLOCK_PROCESS_CPUTIME_ID macro never
gets defined.

Reviewed by: davidxu

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

10 years agoPartial MFC of r248534: Implement SOCK_CLOEXEC and SOCK_NONBLOCK in kernel.
jilles [Fri, 6 Sep 2013 12:45:08 +0000 (12:45 +0000)]
Partial MFC of r248534: Implement SOCK_CLOEXEC and SOCK_NONBLOCK in kernel.

SOCK_CLOEXEC and SOCK_NONBLOCK can be OR'ed in socket() and socketpair()'s
type parameter.

The numerical values for SOCK_CLOEXEC and SOCK_NONBLOCK are as in NetBSD.

The SOCK_* flags are not passed to MAC because this may cause incorrect
failures and can be done later via fcntl() anyway. On the other hand, audit
is expected to cope with the new flags.

This commit does not add the constants to <sys/socket.h> as in r248534
because this would lead to various newly compiled software not working on
old kernels. It only serves to help 10.x binaries and prepare for a possible
full MFC (if third-party software starts to insist on SOCK_CLOEXEC and
SOCK_NONBLOCK).

MSG_CMSG_CLOEXEC from r248534 is not merged here because it changes a
KPI/KBI.

No mergeinfo because the rest of r248534 is missing.

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

10 years agoMerge r254809 and r254937 from head:
joerg [Thu, 5 Sep 2013 19:25:36 +0000 (19:25 +0000)]
Merge r254809 and r254937 from head:

. Fix the "2step" feature (i.e. 360 KiB floppies in 1200 MiB drives)
. Fix the FDOPT_NOERROR option

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

10 years agoMFC r254326:
pfg [Thu, 5 Sep 2013 15:50:34 +0000 (15:50 +0000)]
MFC r254326:

Add support for the GCC binary integer constants extension.

This is required to build the i965 backend with newer versions of mesa.

Original patch from Joerg Wunsch in GCC Bug 23479, under the GPLv2;
also taken from there in OpenBSD.

Obtained from: gcc 4.3 (rev. 125346; GPLv2)

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

10 years agoMFC r255056
erwin [Thu, 5 Sep 2013 06:58:49 +0000 (06:58 +0000)]
MFC r255056
  Reduce WARNS to 0 for dig, host, and nslookup to make them
  compile with the optional WITH_BIND_SIGCHASE.

  Submitted by: Andre Albsmeier <Andre.Albsmeier@siemens.com>
  Approved by:  delphij (mentor, implicit)
  Sponsored by: DK Hostmaster A/S

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

10 years agoMFC r254018:
markj [Tue, 3 Sep 2013 23:17:18 +0000 (23:17 +0000)]
MFC r254018:
Pass variables prefixed with both LD_ and LD_32_ to the run-time linker.
This prevents unintentional execution of programs when running ldd(1) on
32-bit Linux binaries.

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

10 years agoAdd read-only support for extents in ext2fs.
pfg [Tue, 3 Sep 2013 18:46:11 +0000 (18:46 +0000)]
Add read-only support for extents in ext2fs.

Basic support for extents was implemented by Zheng Liu as part
of his Google Summer of Code in 2010. This support is read-only
at this time.

In addition to extents we also support the huge_file extension
for read-only purposes. This works nicely with the additional
support for birthtime/nanosec timestamps and dir_index that
have been added lately.

The implementation may not work for all ext4 filesystems as
it doesn't support some features that are being enabled by
default on recent linux like flex_bg. Nevertheless, the feature
should be very useful for migration or simple access in
filesystems that have been converted from ext2/3 or don't use
incompatible features.

Special thanks to Zheng Liu for his dedication and continued
work to support ext2 in FreeBSD.

Submitted by: Zheng Liu (lz@)
Reviewed by: Mike Ma, Christoph Mallon (previous version)
Sponsored by: Google Inc.

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

10 years agoAdd read-only support for extents in ext2fs.
pfg [Tue, 3 Sep 2013 16:29:14 +0000 (16:29 +0000)]
Add read-only support for extents in ext2fs.

Basic support for extents was implemented by Zheng Liu as part
of his Google Summer of Code in 2010. This support is read-only
at this time.

In addition to extents we also support the huge_file extension
for read-only purposes. This works nicely with the additional
support for birthtime/nanosec timestamps and dir_index that
have been added lately.

The implementation may not work for all ext4 filesystems as
it doesn't support some features that are being enabled by
default on recent linux like flex_bg. Nevertheless, the feature
should be very useful for migration or simple access in
filesystems that have been converted from ext2/3 or don't use
incompatible features.

Special thanks to Zheng Liu for his dedication and continued
work to support ext2 in FreeBSD.

Submitted by: Zheng Liu (lz@)
Reviewed by: Mike Ma, Christoph Mallon (previous version)
Sponsored by: Google Inc.

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

10 years agoMFC r254945:
kib [Tue, 3 Sep 2013 05:20:42 +0000 (05:20 +0000)]
MFC r254945:
When allocating a pbuf for the cluster write, do not sleep waiting
for the available pbuf when passed vnode is backing md(4). Other i/o
directed to the same md device might already hold pbufs, and then we
could deadlock since only our progress can free a pbuf needed for
wakeup.

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

10 years agoMFC of 253998:
mckusick [Sat, 31 Aug 2013 17:38:49 +0000 (17:38 +0000)]
MFC of 253998:

This bug fix is in a code path in rename taken when there is a
collision between a rename and an open system call for the same
target file. Here, rename releases its vnode references, waits for
the open to finish, and then restarts by reacquiring its needed
vnode locks. In this case, rename was unlocking but failing to
release its reference to one of its held vnodes. The effect was
that even after all the actual references to the vnode had gone,
the vnode still showed active references. For files that had been
removed, their space was not reclaimed until the filesystem was
forcibly unmounted.

This bug manifested itself in the Postgres server which would
leak/lose hundreds of files per day amounting to many gigabytes of
disk space. This bug required shutting down Postgres, forcibly
unmounting its filesystem, remounting its filesystem and restarting
Postgres every few days to recover the lost space.

Reported by: Dan Thomas and Palle Girgensohn
Bug-fix by:  kib
Tested by:   Dan Thomas and Palle Girgensohn

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

10 years agoMFC of 253973:
mckusick [Sat, 31 Aug 2013 17:33:25 +0000 (17:33 +0000)]
MFC of 253973:

To better understand performance problems with journalled soft updates,
we need to collect the highest level of allocation for each of the
different soft update dependency structures. This change collects these
statistics and makes them available using `sysctl debug.softdep.highuse'.

Reviewed by: kib
Tested by:   Peter Holm

MFC of 253974:

With the addition of journalled soft updates, the "newblk" structures
persist much longer than previously. Historically we had at most 100
entries; now the count may reach a million. With the increased count
we spent far too much time looking them up in the grossly undersized
newblk hash table. Configure the newblk hash table to accurately reflect
the number of entries that it must index.

Reviewed by: kib
Tested by:   Peter Holm
MFC after:   2 weeks

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

10 years agoMFC r254231: fnmatch(): Add test for r254353 (pattern with single backslash)
jilles [Fri, 30 Aug 2013 10:10:22 +0000 (10:10 +0000)]
MFC r254231: fnmatch(): Add test for r254353 (pattern with single backslash)

This test cannot be converted to an sh(1) test because the syntax would be
invalid.

r254091 was merged to stable/9 as r254353.

PR: 181129

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

10 years agoMFC r254335: sh: Allow a lone redirection before '|', ';;' or ';&'.
jilles [Fri, 30 Aug 2013 10:07:10 +0000 (10:07 +0000)]
MFC r254335: sh: Allow a lone redirection before '|', ';;' or ';&'.

Example: </dev/null | :

PR: 181240

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

10 years agoMFC r253910: Add a tunable for the default timeout.
marcel [Fri, 30 Aug 2013 05:36:29 +0000 (05:36 +0000)]
MFC r253910: Add a tunable for the default timeout.

Requested by: rodrigc@, delphij@

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

10 years agoMFC r251587 (by marcel):
ae [Thu, 29 Aug 2013 09:33:10 +0000 (09:33 +0000)]
MFC r251587 (by marcel):
  Remove stub implementation.

MFC r251588 (by marcel):
  Change the set and unset ctlreqs by making the index argument optional.
  This allows setting attributes on tables. One simply does not provide
  an index in that case. Otherwise the entry corresponding the index has
  the attribute set or unset.

  Use this change to fix a relatively longstanding bug in our GPT scheme
  that's the result of rev 198097 (relatively harmless) followed by rev
  237057 (damaging). The damaging part being that our GPT scheme always
  has the active flag set on the PMBR slice. This is in violation with
  EFI. Existing EFI implementions for both x86 and ia64 reject the GPT.
  As such, GPT disks created by us aren't usable under EFI because of
  that.

  After this change, GPT disks never have the active flag set on the PMBR
  slice. In order to make the GPT disk bootable under some x86 BIOSes,
  the reason of rev 198097, one must now set the active attribute on the
  gpt table. The kernel will apply this to the PMBR slice For (S)ATA:
   gpart set -a active ada0

  To fix an existing GPT disk that has the active flag set in the PMBR,
  and that does not need the flag, use (again for (S)ATA):
   gpart unset -a active ada0

  The EBR, MBR & PC98 schemes, which also impement at least 1 attribute,
  now check to make sure the entry passed is valid. They do not have
  attributes that apply to the table.

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

10 years agoMFC 254416:
ken [Wed, 28 Aug 2013 19:22:09 +0000 (19:22 +0000)]
MFC 254416:

  ------------------------------------------------------------------------
  r254416 | ken | 2013-08-16 10:14:32 -0600 (Fri, 16 Aug 2013) | 24 lines

  Add unmapped I/O and larger I/O support to the sa(4) driver.

  We now pay attention to the maxio field in the XPT_PATH_INQ CCB,
  and if it is set, propagate it up to physio via the si_iosize_max
  field in the cdev structure.

  We also now pay attention to the PIM_UNMAPPED capability bit in the
  XPT_PATH_INQ CCB, and set the new SI_UNMAPPED cdev flag when the
  underlying SIM supports unmapped I/O.

  scsi_sa.c: Add unmapped I/O support and propagate the SIM's
   maximum I/O size up.

   Adjust scsi_tape_read_write() in the same way that
   scsi_read_write() was changed to support unmapped
   I/O.  We overload the readop parameter with bits
   that tell us whether it's an unmapped I/O, and we
   need to set the CAM_DATA_BIO CCB flag.  This change
   should be backwards compatible in source and
   binary forms.

  Sponsored by: Spectra Logic

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

10 years agoMFC change 254389:
ken [Tue, 27 Aug 2013 23:02:20 +0000 (23:02 +0000)]
MFC change 254389:

There are some slight differences from the version in FreeBSD/head.
__FreeBSD_version has been bumped to 902503 for the availability
of the SI_UNMAPPED cdev flag, and the D_UNMAPPED_IO cdevsw flag
remains in place.  D_UNMAPPED_IO no longer does anything.  Drivers that
use that flag will just wind up having mapped I/O by default.  The
impact will only be on performance, not functionality.

  Change the way that unmapped I/O capability is advertised.

  The previous method was to set the D_UNMAPPED_IO flag in the cdevsw
  for the driver.  The problem with this is that in many cases (e.g.
  sa(4)) there may be some instances of the driver that can handle
  unmapped I/O and some that can't.  The isp(4) driver can handle
  unmapped I/O, but the esp(4) driver currently cannot.  The cdevsw
  is shared among all driver instances.

  So instead of setting a flag on the cdevsw, set a flag on the cdev.
  This allows drivers to indicate support for unmapped I/O on a
  per-instance basis.

  sys/conf.h: Remove the D_UNMAPPED_IO cdevsw flag and replace it
   with an SI_UNMAPPED cdev flag.

  kern_physio.c: Look at the cdev SI_UNMAPPED flag to determine
   whether or not a particular driver can handle
   unmapped I/O.

  geom_dev.c: Set the SI_UNMAPPED flag for all GEOM cdevs.
   Since GEOM will create a temporary mapping when
   needed, setting SI_UNMAPPED unconditionally will
   work.

   Remove the D_UNMAPPED_IO flag.

  nvme_ns.c: Set the SI_UNMAPPED flag on cdevs created here
   if NVME_UNMAPPED_BIO_SUPPORT is enabled.

  vfs_aio.c: In aio_qphysio(), check the SI_UNMAPPED flag on a
   cdev instead of the D_UNMAPPED_IO flag on the cdevsw.

  sys/param.h: Bump __FreeBSD_version to 1000045 for the switch from
   setting the D_UNMAPPED_IO flag in the cdevsw to setting
   SI_UNMAPPED in the cdev.

  Reviewed by: kib, jimharris
  Sponsored by: Spectra Logic

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

10 years agoProperly record mergeinfo for the merge of revision 254372 from head into
ken [Tue, 27 Aug 2013 20:43:27 +0000 (20:43 +0000)]
Properly record mergeinfo for the merge of revision 254372 from head into
stable/9.

This should have been done in change 254971.

Pointy hat to: ken

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

10 years agoMFC 254372:
ken [Tue, 27 Aug 2013 20:34:11 +0000 (20:34 +0000)]
MFC 254372:

Export the maxio field in the CAM XPT_PATH_INQ CCB in the isp(4)
driver.

This tells consumers up the stack the maximum I/O size that the
controller can handle.

The I/O size is bounded by the number of scatter/gather segments
the controller can handle and the page size.  For an amd64 system,
it works out to around 5MB.

Reviewed by: mjacob
Sponsored by: Spectra Logic

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

10 years agoAdd missing mergeinfo from head for stabe/9 revisions: 252995 253168 253169
dteske [Tue, 27 Aug 2013 18:16:50 +0000 (18:16 +0000)]
Add missing mergeinfo from head for stabe/9 revisions: 252995 253168 253169

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

10 years agoMFC revisions 254942 and 254952:
dteske [Tue, 27 Aug 2013 06:31:50 +0000 (06:31 +0000)]
MFC revisions 254942 and 254952:
Make alternate layout ``opt-in'' and add support for named releases.
Minor edit to version.4th(8) manual and stack-leak fixes while here.

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

10 years agoPartial MFC of r253927 (by attilio):
kib [Tue, 27 Aug 2013 03:11:49 +0000 (03:11 +0000)]
Partial MFC of r253927 (by attilio):
Remove unnecessary soft busy of the page before to do vn_rdwr() in
kern_sendfile() which is unnecessary.

MFC note:
NFS implementation of VOP_READ() sometimes upgrades the vnode lock,
which causes drop of the shared lock and sleep for exclusive.  As
result, busying of the page before the call to vn_rdwr() makes NFS
code to wait for vnode lock while page is busy, which contradicts the
proper order of vnode lock -> busy.

The r250027, merged as part of r250907, started calling vm_page_grab()
under the vnode lock.  The page grab waits for the page busy state to
drain, which makes the parallel sendfile(2) invocations on the same
vnode vulnerable to the LOR described above.

Note that r250027 only exposed the problem, which might be caused by
other means as well, e.g. by parallel sendfile(2) and truncate(2).

Sponsored by: The FreeBSD Foundation

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

10 years agoMFC mps(4) driver changes 253460, 253549, 253550 and 254615.
ken [Mon, 26 Aug 2013 21:34:43 +0000 (21:34 +0000)]
MFC mps(4) driver changes 253460, 253549, 253550 and 254615.

There are some slight changes here from the version in head.

__FreeBSD_version has been bumped to 902502 for the inclusion of the
PIM_RESCAN CAM path inquiry flag.  The ifdefs in the mps(4) driver
have been changed accordingly.

In head, the TDP_NOSLEEPING thread flag has been removed but it
still exists in stable/9.

  ------------------------------------------------------------------------
  r253460 | scottl | 2013-07-18 18:12:41 -0600 (Thu, 18 Jul 2013) | 5 lines

  Overhaul error, information, and debug logging.

  Obtained from: Netflix

  ------------------------------------------------------------------------
  r253549 | ken | 2013-07-22 12:37:07 -0600 (Mon, 22 Jul 2013) | 57 lines

  CAM and mps(4) driver scanning changes.

  Add a PIM_NOSCAN flag to the CAM path inquiry CCB.  This tells CAM
  not to perform a rescan on a bus when it is registered.

  We now use this flag in the mps(4) driver.  Since it knows what
  devices it has attached, it is more efficient for it to just issue
  a target rescan on the targets that are attached.

  Also, remove the private rescan thread from the mps(4) driver in
  favor of the rescan thread already built into CAM.  Without this
  change, but with the change above, the MPS scanner could run before
  or during CAM's initial setup, which would cause duplicate device
  reprobes and announcements.

  sys/param.h:
   Bump __FreeBSD_version to 1000039 for the inclusion of the
   PIM_RESCAN CAM path inquiry flag.

  sys/cam/cam_ccb.h:
  sys/cam/cam_xpt.c:
   Added a PIM_NOSCAN flag.  If a SIM sets this in the path
   inquiry ccb, then CAM won't rescan the bus in
   xpt_bus_regsister.

  sys/dev/mps/mps_sas.c
   For versions of FreeBSD that have the PIM_NOSCAN path
   inquiry flag, don't freeze the sim queue during scanning,
   because CAM won't be scanning this bus.  Instead, hold
   up the boot.  Don't call mpssas_rescan_target in
   mpssas_startup_decrement; it's redundant and I don't
   know why it was in there.

   Set PIM_NOSCAN in path inquiry CCBs.

   Remove methods related to the internal rescan daemon.

   Always use async events to trigger a probe for EEDP support.
   In older versions of FreeBSD where AC_ADVINFO_CHANGED is
   not available, use AC_FOUND_DEVICE and issue the
   necessary READ CAPACITY manually.

   Provide a path to xpt_register_async() so that we only
   receive events for our own SCSI domain.

   Improve error reporting in cases where setup for EEDP
   detection fails.

  sys/dev/mps/mps_sas.h:
   Remove softc flags and data related to the scanner thread.

  sys/dev/mps/mps_sas_lsi.c:
   Unconditionally rescan the target whenever a device is added.

  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------
  r253550 | ken | 2013-07-22 12:41:53 -0600 (Mon, 22 Jul 2013) | 93 lines

  Merge in phase 14+ -> 16 mps driver fixes from LSI:

  ---------------------------------------------------------------
  System panics during a Port reset with ouststanding I/O
  ---------------------------------------------------------------
  It is possible to call mps_mapping_free_memory after this
  memory is already freed, causing a panic. Removed this extra
  call to mps_mappiing_free_memory and call mps_mapping_exit
  in place of the mps_mapping_free_memory call so that any
  outstanding mapping items can be flushed before memory is
  freed.

  ---------------------------------------------------------------
  Correct memory leak during a Port reset with ouststanding I/O
  ---------------------------------------------------------------
  In mps_reinit function, the mapping memory was not being
  freed before being re-allocated. Added line to call the
  memory free function for mapping memory.

  ---------------------------------------------------------------
  Use CAM_SIM_QUEUED flag in Driver IO path.
  ---------------------------------------------------------------
  This flag informs the XPT that successful abort of a CCB
  requires an abort ccb to be issued to the SIM.  While
  processing SCSI IO's, set the CAM_SIM_QUEUED flag in the
  status for the IO. When the command completes, clear this
  flag.

  ---------------------------------------------------------------
  Check for CAM_REQ_INPROG in I/O path.
  ---------------------------------------------------------------
  Added a check in mpssas_action_scsiio for the In Progress
  status for the IO. If this flag is set, the IO has already
  been aborted by the upper layer (before CAM_SIM_QUEUED was
  set) and there is no need to send the IO. The request will
  be completed without error.

  ---------------------------------------------------------------
  Improve "doorbell handshake method" for mps_get_iocfacts
  ---------------------------------------------------------------
  Removed call to get Port Facts since this information is
  not used currently.

  Added mps_iocfacts_allocate function to allocate memory
  that is based on IOC Facts data.  Added mps_iocfacts_free
  function to free memory that is based on IOC Facts data.
  Both of the functions are used when a Diag Reset is performed
  or when the driver is attached/detached. This is needed in
  case IOC Facts changes after a Diag Reset, which could
  happen if FW is upgraded.

  Moved call of mps_bases_static_config_pages from the attach
  routine to after the IOC is ready to process accesses based
  on the new memory allocations (instead of polling through
  the Doorbell).

  ---------------------------------------------------------------
  Set TimeStamp in INIT message in millisecond format Set the IOC
  ---------------------------------------------------------------

  ---------------------------------------------------------------
  Prefer mps_wait_command to mps_request_polled
  ---------------------------------------------------------------
  Instead of using mps_request_polled, call mps_wait_command
  whenever possible. Change the mps_wait_command function to
  check the current context and either use interrupt context
  or poll if required by using the pause or DELAY function.
  Added a check after waiting 50mSecs to see if the command
  has timed out. This is only done if polliing, the msleep
  command will automatically timeout if the command has taken
  too long to complete.

  ---------------------------------------------------------------
  Integrated RAID: Volume Activation Failed error message is
  displayed though the volume has been activated.
  ---------------------------------------------------------------
  Instead of failing an IOCTL request that does not have a
  large enough buffer to hold the complete reply, copy as
  much data from the reply as possible into the user's buffer
  and log a message saying that the user's buffer was smaller
  than the returned data.

  ---------------------------------------------------------------
  mapping_add_new_device failure due to persistent table FULL
  ---------------------------------------------------------------
  When a new device is added, if it is determined that the
  device persistent table is being used and is full, instead
  of displaying a message for this condition every time, only
  log a message if the MPS_INFO bit is set in the debug_flags.

  Submitted by: LSI

  ------------------------------------------------------------------------
  r254615 | ken | 2013-08-21 15:30:56 -0600 (Wed, 21 Aug 2013) | 32 lines

  Fix mps(4) driver breakage that came in in change 253550 that
  manifested itself in out of chain frame conditions.

  When the driver ran out of chain frames, the request in question
  would get completed early, and go through mpssas_scsiio_complete().

  In mpssas_scsiio_complete(), the negation of the CAM status values
  (CAM_STATUS_MASK | CAM_SIM_QUEUED) was ORed in instead of being
  ANDed in.  This resulted in a bogus CAM CCB status value.  This
  didn't show up in the non-error case, because the status was reset
  to something valid (e.g. CAM_REQ_CMP) later on in the function.

  But in the error case, such as when the driver ran out of chain
  frames, the CAM_REQUEUE_REQ status was ORed in to the bogus status
  value.  This led to the CAM transport layer repeatedly releasing
  the SIM queue, because it though that the CAM_RELEASE_SIMQ flag had
  been set.  The symptom was messages like this on the console when
  INVARIANTS were enabled:

  xpt_release_simq: requested 1 > present 0
  xpt_release_simq: requested 1 > present 0
  xpt_release_simq: requested 1 > present 0

  mps_sas.c: In mpssas_scsiio_complete(), use &= to take status
   bits out.  |= adds them in.

   In the error case in mpssas_scsiio_complete(), set
   the status to CAM_REQUEUE_REQ, don't OR it in.

  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------

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

10 years agoMFC r254651:
erwin [Mon, 26 Aug 2013 07:17:41 +0000 (07:17 +0000)]
MFC r254651:

Update Bind to 9.9.3-P2

Notable new features:

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

*  Introduces a new tool "dnssec-verify" that validates a signed zone,
   checking for the correctness of signatures and NSEC/NSEC3 chains.
   [RT #23673]

*  BIND now recognizes the TLSA resource record type, created to
   support IETF DANE (DNS-based Authentication of Named Entities)
   [RT #28989]

*  The new "inline-signing" option, in combination with the
   "auto-dnssec" option that was introduced in BIND 9.7, allows
   named to sign zones completely transparently.

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

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

10 years agoMFC r226840: AESNI-related commit, from a long time ago:
roberto [Sun, 25 Aug 2013 14:29:47 +0000 (14:29 +0000)]
MFC r226840: AESNI-related commit, from a long time ago:

Before this change when GELI detected hardware crypto acceleration it will
start only one worker thread. For software crypto it will start by default
N worker threads where N is the number of available CPUs.

This is not optimal if hardware crypto is AES-NI, which uses CPU for AES
calculations.

Change that to always start one worker thread for every available CPU.
Number of worker threads per GELI provider can be easly reduced with
kern.geom.eli.threads sysctl/tunable and even for software crypto it
should be reduced when using more providers.

While here, when number of threads exceeds number of CPUs avilable don't
reduce this number, assume the user knows what he is doing.

Submitted by: Michael Moll <kvedulv@kvedulv.de>

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

10 years agoMerge r226837 & r226839 from head:
roberto [Sun, 25 Aug 2013 13:10:03 +0000 (13:10 +0000)]
Merge r226837 & r226839 from head:

r226837:
Improve AES-NI performance for AES-XTS:
- Operate on uint64_t types when doing XORing, etc. instead of uint8_t.
- Don't bzero() temporary block for every AES block. Do it once for entire
  data block.
- AES-NI is available only on little endian architectures. Simplify code
  that takes block number from IV.

r226839:
Update Copyright.

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

10 years agoMFC r253651, r253652, r253657;
pfg [Sat, 24 Aug 2013 17:45:42 +0000 (17:45 +0000)]
MFC r253651, r253652, r253657;

ext2fs: Don't assume that on-disk format of a directory is the same
as in <sys/dirent.h>

ext2_readdir() has always been very fs specific and different
with respect to its ufs_ counterpart. Recent changes from UFS
have made it possible to share more closely the implementation.

Always start parsing at DIRBLKSIZ aligned offset, skip first entries if
uio_offset is not DIRBLKSIZ aligned. Return EINVAL if buffer is too
small for single entry.

Preallocate buffer for cookies.

Skip entries with zero inode number.

Reviewed by: gleb, Zheng Liu

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

10 years agoMFC r254465: Correct implementation of atomic_flag_test_and_set
emaste [Sat, 24 Aug 2013 13:49:43 +0000 (13:49 +0000)]
MFC r254465: Correct implementation of atomic_flag_test_and_set

(This is a direct commit to stable/9 as atomic_flag_test_and_set_explicit
is an inline function on HEAD and in a different file.)

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

10 years agoMFC r253282:
trociny [Sat, 24 Aug 2013 12:10:11 +0000 (12:10 +0000)]
MFC r253282:

A complete duplication of binding should be allowed if on both new and
duplicated sockets a multicast address is bound and either
SO_REUSEPORT or SO_REUSEADDR is set.

But actually it works for the following combinations:

  * SO_REUSEPORT is set for the fist socket and SO_REUSEPORT for the new;
  * SO_REUSEADDR is set for the fist socket and SO_REUSEADDR for the new;
  * SO_REUSEPORT is set for the fist socket and SO_REUSEADDR for the new;

and fails for this:

  * SO_REUSEADDR is set for the fist socket and SO_REUSEPORT for the new.

Fix the last case.

PR: 179901

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

10 years agoMFC r254438:
hselasky [Sat, 24 Aug 2013 07:17:28 +0000 (07:17 +0000)]
MFC r254438:
Fix some USB controller names according to pciconf output.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

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

10 years agoMFC r254582:
dim [Fri, 23 Aug 2013 18:04:13 +0000 (18:04 +0000)]
MFC r254582:

Pull in r182983 from upstream clang trunk:

  Fix handling of braced-init-list as reference initializer within
  aggregate initialization. Previously we would incorrectly require an
  extra set of braces around such initializers.

Pull in r188718 from upstream clang trunk:

  Handle init lists and _Atomic fields.

  Fixes PR16931.

These fixes are needed for the atomic_flag type to work correctly in our
stdatomic.h.

Requested by: theraven

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

10 years agoMFC r254581:
dim [Fri, 23 Aug 2013 18:02:37 +0000 (18:02 +0000)]
MFC r254581:

Pull in r188716 from upstream clang trunk:

  PR16727: don't try to evaluate a potentially value-dependent
  expression when checking for missing parens in &&/|| expressions.

This fixes an assertion encountered when building the lang/sdcc port.

Reported by: kwm

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

10 years agoMFC r253677,253679: make path matching in devfs rules consistent and
avg [Fri, 23 Aug 2013 14:24:46 +0000 (14:24 +0000)]
MFC r253677,253679: make path matching in devfs rules consistent and
sane (and safer)

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

10 years agoMFC r253996,253997: opensolaris code: translate INVARIANTS to DEBUG and ZFS_DEBUG
avg [Fri, 23 Aug 2013 14:17:45 +0000 (14:17 +0000)]
MFC r253996,253997: opensolaris code: translate INVARIANTS to DEBUG and ZFS_DEBUG

Please note that support for compiling ZFS into a kernel is not in this
branch as of now.

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

10 years agoMFC r253772,253773,253989: dtrace disassembler: take the latest/last
avg [Fri, 23 Aug 2013 14:03:08 +0000 (14:03 +0000)]
MFC r253772,253773,253989: dtrace disassembler: take the latest/last
CDDL code from OpenSolaris

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

10 years agoMFC r253606: zfs module: perform cleanup during shutdown in addition to
avg [Fri, 23 Aug 2013 13:29:53 +0000 (13:29 +0000)]
MFC r253606: zfs module: perform cleanup during shutdown in addition to
module unload

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

10 years agoMFC r253603: zfs: move vnode creation from zfs_znode_cache_constructor
avg [Fri, 23 Aug 2013 13:27:13 +0000 (13:27 +0000)]
MFC r253603: zfs: move vnode creation from zfs_znode_cache_constructor
to zfs_znode_alloc

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

10 years agoMFC r253604: rename scheduler->swapper and SI_SUB_RUN_SCHEDULER->SI_SUB_LAST
avg [Fri, 23 Aug 2013 13:20:11 +0000 (13:20 +0000)]
MFC r253604: rename scheduler->swapper and SI_SUB_RUN_SCHEDULER->SI_SUB_LAST

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

10 years agoRevert r254626 to fix the build.
gjb [Thu, 22 Aug 2013 18:41:28 +0000 (18:41 +0000)]
Revert r254626 to fix the build.

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

10 years agoRegenerate.
kib [Thu, 22 Aug 2013 17:33:50 +0000 (17:33 +0000)]
Regenerate.

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

10 years agoMFC r253494:
kib [Thu, 22 Aug 2013 17:30:01 +0000 (17:30 +0000)]
MFC r253494:
id_t is 64bit, provide the compat32 wrapper for clock_getcpuclockid2(2).

Reminded by: Petr Salinger <Petr.Salinger@seznam.cz>

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

10 years agoMFC r254095:
ae [Thu, 22 Aug 2013 06:20:25 +0000 (06:20 +0000)]
MFC r254095:
  gpt_entries is used as limit for the number of partition entries in
  the GEOM_PART. Instead of just using number of entries from the GPT
  header, calculate this limit based on the reserved space between
  GPT header and first available LBA.

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

10 years agoFix an integer overflow in computing the size of a temporary buffer
delphij [Thu, 22 Aug 2013 00:51:37 +0000 (00:51 +0000)]
Fix an integer overflow in computing the size of a temporary buffer
can result in a buffer which is too small for the requested
operation.

Security: CVE-2013-3077
Security: FreeBSD-SA-13:09.ip_multicast

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

10 years agoProvide a prototype for yyparse() so that "-Werror" along with stringent
obrien [Wed, 21 Aug 2013 22:57:29 +0000 (22:57 +0000)]
Provide a prototype for yyparse() so that "-Werror" along with stringent
-W* warnings can be used on byacc's output.

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

10 years agoMFC r241077:
tijl [Wed, 21 Aug 2013 19:02:34 +0000 (19:02 +0000)]
MFC r241077:

- Simplify the implementation of atomic_compare_exchange_strong_explicit.
- Evaluate the memory order argument in atomic_fetch_*_explicit macros.
- Implement atomic_store_explicit using atomic_exchange_explicit instead
  of a plain assignment.

MFC r241190:

Define clang feature test macro __has_extension. It's used in stdatomic.h.

MFC r254497:

Change the return type of the fallback implementation of the
atomic_compare_exchange_* macros in stdatomic.h to _Bool.

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

10 years agoMFC r254457
bryanv [Tue, 20 Aug 2013 19:13:13 +0000 (19:13 +0000)]
MFC r254457
  Do not use potentially stale thread in kthread_add()

  When an existing process is provided, the thread selected to use
  to initialize the new thread could have exited and be reaped.
  Acquire the proc lock earlier to ensure the thread remains valid.

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

10 years agoMFC r250342, r251495:
emaste [Tue, 20 Aug 2013 14:29:43 +0000 (14:29 +0000)]
MFC r250342, r251495:

  Add libusb_get_port_path wrapper

  This follows the libusbx API reference at
  http://libusbx.sourceforge.net/api-1.0/group__dev.html

  Add libusb_get_port_numbers

  libusbx deprecated libusb_get_port_path and replaced it with
  libusb_get_port_numbers.  The latter omits an extra parameter which was
  unused in the FreeBSD implementation anyway.

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

10 years agoMFC r250335: Constify libusb_get_pollfds return
emaste [Tue, 20 Aug 2013 14:25:44 +0000 (14:25 +0000)]
MFC r250335: Constify libusb_get_pollfds return

  The correct return type, per our libusb(3) man page and the libusb.org
  and libusbx projects (whose interface we intend to follow for our
  libusb), is const struct libusb_pollfd **.

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

10 years agoMFC r250201 from hselasky:
emaste [Tue, 20 Aug 2013 14:19:00 +0000 (14:19 +0000)]
MFC r250201 from hselasky:

  Add new USB API to get the port path of a USB device.

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

10 years agoMFC r254243:
hselasky [Tue, 20 Aug 2013 07:28:24 +0000 (07:28 +0000)]
MFC r254243:
- Try to fix build of 32-bit compatibility USB support for FreeBSD and
  Linux targets without breaking the existing IOCTL API.

- Remove some not-needed header file inclusions.

- Wrap a long line.

Reported by: Damjan Jovanovic <damjan.jov@gmail.com>

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

10 years agoMFH (r254278): fix relative symlinks
des [Tue, 20 Aug 2013 07:22:20 +0000 (07:22 +0000)]
MFH (r254278): fix relative symlinks

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

10 years agoMFC r254238:
hselasky [Tue, 20 Aug 2013 07:13:01 +0000 (07:13 +0000)]
MFC r254238:
Correct an EHCI register write.

Reported by:    aseem.jolly@gmail.com

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

10 years agoMFC r253967:
kib [Tue, 20 Aug 2013 07:11:53 +0000 (07:11 +0000)]
MFC r253967:
Wait for the doomed vnode to be detached from the tmpfs
node if sleepable allocation is requested.

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

10 years agoMFC r254397:
gjb [Tue, 20 Aug 2013 00:35:21 +0000 (00:35 +0000)]
MFC r254397:
  Mark the makefs(8) '-p' flag as deprecated in preference for
  the '-Z' flag for compatibility with NetBSD.

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

10 years agoMFC r254525:
gjb [Mon, 19 Aug 2013 14:38:28 +0000 (14:38 +0000)]
MFC r254525:
 Add entry for packages-9.2-release directory.

Approved by: re (implicit)

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

10 years agoMFC a bundle of commits that bring autotuning to mbufs, maxfiles/sockets
andre [Mon, 19 Aug 2013 09:49:51 +0000 (09:49 +0000)]
MFC a bundle of commits that bring autotuning to mbufs, maxfiles/sockets
and maxusers to the 9-stable branch.  It is committed as bundle because
these patches build on each other and only provide the functionality in
their entirety.  Some are bug fixes to aspects of earlier commits.

MFC r242029 (alfred):

 Allow autotune maxusers > 384 on 64 bit machines.

MFC r242847 (alfred):

 Allow maxusers to scale on machines with large address space.

MFC r243631 (andre):

 Base the mbuf related limits on the available physical memory or
 kernel memory, whichever is lower.  The overall mbuf related memory
 limit must be set so that mbufs (and clusters of various sizes)
 can't exhaust physical RAM or KVM.

 At the same time divorce maxfiles from maxusers and set maxfiles to
 physpages / 8 with a floor based on maxusers.  This way busy servers
 can make use of the significantly increased mbuf limits with a much
 larger number of open sockets.

MFC r243639 (andre):

 Complete r243631 by applying the remainder of kern_mbuf.c that got
 lost while merging into the commit tree.

MFC r243668 (andre):

 Using a long is the wrong type to represent the realmem and maxmbufmem
 variable as they may overflow on i386/PAE and i386 with > 2GB RAM.

MFC r243995, r243996, r243997 (pjd):

 Style cleanups, Make use of the fact that uma_zone_set_max(9) already
 returns actual limit set.

MFC r244080 (andre):

 Prevent long type overflow of realmem calculation on ILP32 by forcing
 calculation to be in quad_t space.  Fix style issue with second parameter
 to qmin().

MFC r245469 (alfred):

 Do not autotune ncallout to be greater than 18508.

MFC r245575 (andre):

 Move the mbuf memory limit calculations from init_param2() to
 tunable_mbinit() where it is next to where it is used later.

MFC r246207 (andre):

 Remove unused VM_MAX_AUTOTUNE_NMBCLUSTERS define.

MFC r249843 (andre):

 Base the calculation of maxmbufmem in part on kmem_map size
 instead of kernel_map size to prevent kernel memory exhaustion
 by mbufs and a subsequent panic on physical page allocation
 failure.

MFC r253204 (andre):

 Fix style issues, a typo in "kern.ipc.nmbufs" and correctly plave and
 expose the value of the tunable maxmbufmem as "kern.ipc.maxmbufmem"
 through sysctl.

MFC r253207 (andre):

 Make use of the fact that uma_zone_set_max(9) already returns the
 rounded limit making a call to uma_zone_get_max(9) unnecessary.

Tested by: alfred (iXsystems)

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

10 years agoMFC r251192: Fix misspelling of structure field name.
emaste [Mon, 19 Aug 2013 07:00:13 +0000 (07:00 +0000)]
MFC r251192: Fix misspelling of structure field name.

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

10 years agoMFC r240970:
emaste [Sun, 18 Aug 2013 08:24:58 +0000 (08:24 +0000)]
MFC r240970:

  - Make C11 atomic macros usable in expressions:
    - Replace do-while statements with void expressions.
    - Wrap __asm statements in statement expressions.
  - Make the macros function-like:
    - Evaluate all arguments exactly once.
    - Make sure there's a sequence point between evaluation of the
      arguments and the function body. Arguments should be evaluated
      before any memory barriers.
  - Fix use of __atomic_is_lock_free built-in. It requires the address
    of an atomic variable as second argument. Use this built-in on clang
    as well because clang's __c11_atomic_is_lock_free only takes the size
    of the variable into account.
  - In atomic_exchange_explicit put the barrier before instead of after
    the __sync_lock_test_and_set call.

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

10 years agoMFC r239960:
emaste [Sun, 18 Aug 2013 08:18:49 +0000 (08:18 +0000)]
MFC r239960:

  Properly enable Clang-style atomics when available.

  In addition to testing against cxx_atomic, we must check c_atomic. The
  former is only set when building C++ code. Also use __has_extension
  instead of __has_feature. This allows us to use the atomics outside of
  C11.

PR: threads/170073

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

10 years agoFix the mismerge in r254444, use '==' instead of '='.
kib [Sat, 17 Aug 2013 16:42:18 +0000 (16:42 +0000)]
Fix the mismerge in r254444, use '==' instead of '='.

Pointed out by: jilles, John Wehle <john@feith.com>

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

10 years agoMFC r253969:
kib [Sat, 17 Aug 2013 08:31:34 +0000 (08:31 +0000)]
MFC r253969:
Do not override the ENOENT error for the empty path, or EFAULT errors
from copyins, with the relative lookup check.

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

10 years agoMFC r254191:
kib [Sat, 17 Aug 2013 08:05:32 +0000 (08:05 +0000)]
MFC r254191:
Match malloc(9) calls with free(9), not contigfree(9).

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

10 years agoMFC 253983, 253984:
erwin [Fri, 16 Aug 2013 07:11:13 +0000 (07:11 +0000)]
MFC 253983, 253984:

  Update Bind to 9.8.5-P2

  New Features

     Adds a new configuration option, "check-spf"; valid values are
     "warn" (default) and "ignore".  When set to "warn", checks SPF
     and TXT records in spf format, warning if either resource record
     type occurs without a corresponding record of the other resource
     record type.  [RT #33355]

     Adds support for Uniform Resource Identifier (URI) resource
     records. [RT #23386]

     Adds support for the EUI48 and EUI64 RR types. [RT #33082]

     Adds support for the RFC 6742 ILNP record types (NID, LP, L32,
     and L64). [RT #31836]

  Feature Changes

     Changes timing of when slave zones send NOTIFY messages after
     loading a new copy of the zone.  They now send the NOTIFY before
     writing the zone data to disk.  This will result in quicker
     propagation of updates in multi-level server structures. [RT #27242]
     "named -V" can now report a source ID string.  (This is will be
     of most interest to developers and troubleshooters).  The source

     ID for ISC's production versions of BIND is defined in the "srcid"
     file in the build tree and is normally set to the most recent
     git hash. [RT #31494]

     Response Policy Zone performance enhancements.  New "response-policy"
     option "min-ns-dots".  "nsip" and "nsdname" now enabled by default
     with RPZ. [RT #32251]

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

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

10 years agoRegen.
davidxu [Fri, 16 Aug 2013 06:42:24 +0000 (06:42 +0000)]
Regen.

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

10 years agoMFC r239347, 240295, 240296 and 253325:
davidxu [Fri, 16 Aug 2013 06:40:12 +0000 (06:40 +0000)]
MFC r239347, 240295, 240296 and 253325:

    r239347 | davidxu | 2012-08-17 10:26:31 +0800 (Fri, 17 Aug 2012) | 7 lines

    Implement syscall clock_getcpuclockid2, so we can get a clock id
    for process, thread or others we want to support.
    Use the syscall to implement POSIX API clock_getcpuclock and
    pthread_getcpuclockid.

    PR: 168417

    ------------------------------------------------------------------------
    r240295 | davidxu | 2012-09-10 13:00:29 +0800 (Mon, 10 Sep 2012) | 2 lines

    Add missing prototype for clock_getcpuclockid.

    ------------------------------------------------------------------------
    r240296 | davidxu | 2012-09-10 13:09:39 +0800 (Mon, 10 Sep 2012) | 2 lines

    Process CPU-Time Clocks option is supported, define _POSIX_CPUTIME.

    ------------------------------------------------------------------------
    r253325 | kib | 2013-07-14 03:32:50 +0800 (Sun, 14 Jul 2013) | 6 lines

    Allow to call clock_gettime() on the clock id for zombie process.

    Reported by: Petr Salinger <Petr.Salinger@seznam.cz>
    PR: threads/180496
    Sponsored by: The FreeBSD Foundation

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

10 years agoMFC r254264 Make the igb_mq_start() routine use TRYLOCK rather than simple
jfv [Thu, 15 Aug 2013 21:24:43 +0000 (21:24 +0000)]
MFC r254264  Make the igb_mq_start() routine use TRYLOCK rather than simple
             queuing, there were latency and other problems with the latter.

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

10 years agoMFC r254262 Further improve the msix setup, make sure pci_alloc_msix() gives us
jfv [Thu, 15 Aug 2013 21:06:38 +0000 (21:06 +0000)]
MFC r254262  Further improve the msix setup, make sure pci_alloc_msix() gives us
             the vectors we requested, and fall back to MSI when not, also release
             any allocated resources before the fallback.

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

10 years agoMFC r254008 Make the fallback from MSIX to MSI interrupt usage more graceful.
jfv [Thu, 15 Aug 2013 20:33:17 +0000 (20:33 +0000)]
MFC r254008 Make the fallback from MSIX to MSI interrupt usage more graceful.

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

10 years agoMFC r254092:
ae [Thu, 15 Aug 2013 13:09:58 +0000 (13:09 +0000)]
MFC r254092:
  Make the check for number of entries less strict.
  Some partitioning tools can create GPT with number of entries less
  than 128.

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

10 years agoMFC r254265:
gjb [Thu, 15 Aug 2013 10:31:31 +0000 (10:31 +0000)]
MFC r254265:
 Make sure bootonly.iso for -BETAs and -RCs use the releases/
 directory on the FTP mirrors to fetch distributions, since
 these are always pushed to releases/ during the release cycle.

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

10 years agoMFC: r254091
ache [Thu, 15 Aug 2013 04:27:10 +0000 (04:27 +0000)]
MFC: r254091

According to POSIX \ in the fnmatch(3) pattern should escape
any character including '\0', but our version replace escaped '\0'
with '\\'.
I.e. fnmatch("\\", "\\", 0) should not match while fnmatch("\\", "", 0)
should (Linux and NetBSD does the same). Was vice versa.

PR:     181129

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

10 years agoMFC r254338:
tuexen [Thu, 15 Aug 2013 04:25:16 +0000 (04:25 +0000)]
MFC r254338:
Don't send uninitialized memory (two instances of 4 bytes) in
every cookie on the wire. This bug was reported in
https://bugzilla.mozilla.org/show_bug.cgi?id=905080

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

10 years agoMFC: Temporarily revert sendmail 8.14.7 change to getipnodebyname() flags
gshapiro [Thu, 15 Aug 2013 01:32:48 +0000 (01:32 +0000)]
MFC: Temporarily revert sendmail 8.14.7 change to getipnodebyname() flags
     to prevent problems between the resolver and Microsoft DNS servers with
     AAAA lookups.  The upstream open source project will work on a more
     permanent fix for the next release.  Issue noted by Pavel Timofeev.

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

10 years agoMFC r253986:
ae [Wed, 14 Aug 2013 18:33:39 +0000 (18:33 +0000)]
MFC r253986:
  Fix formatting warning.

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

10 years agoMFC r253853:
jlh [Wed, 14 Aug 2013 17:49:08 +0000 (17:49 +0000)]
MFC r253853:
  Include /usr/local/etc/libmap.d/ by default.

  PR:             180568
  Reviewed by:    bapt
  Obtained from:  kib

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

10 years agoMFC r254237:
dteske [Wed, 14 Aug 2013 16:15:14 +0000 (16:15 +0000)]
MFC r254237:
Add optional support for default override of standard setup; but only if
corresponding functions are provided. If override function does not exist,
boot remains unmodified. This patch should not result in any changes.

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

10 years agoMFC r253850:
markj [Wed, 14 Aug 2013 02:36:21 +0000 (02:36 +0000)]
MFC r253850:
Properly print arguments to vfork(2) and rfork(2).

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

10 years agoMFC r254017:
markj [Wed, 14 Aug 2013 02:00:37 +0000 (02:00 +0000)]
MFC r254017:
Fill in the description fields for M_FICT_PAGES.

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

10 years agoMFC r254020:
markj [Wed, 14 Aug 2013 01:55:01 +0000 (01:55 +0000)]
MFC r254020:
Add a missing module version declaration to if_tun(4).

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

10 years agoMerge r254263:
scottl [Tue, 13 Aug 2013 22:05:50 +0000 (22:05 +0000)]
Merge r254263:

Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI
command register.  The lazy BAR allocation code in FreeBSD sometimes
disables this bit when it detects a range conflict, and will re-enable
it on demand when a driver allocates the BAR.  Thus, the bit is no longer
a reliable indication of capability, and should not be checked.  This
results in the elimination of a lot of code from drivers, and also gives
the opportunity to simplify a lot of drivers to use a helper API to set
the busmaster enable bit.

This changes fixes some recent reports of disk controllers and their
associated drives/enclosures disappearing during boot.

Candidate for 9.2

Submitted by: jhb
Reviewed by: jfv, marius, adrian, achim

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

10 years agoMFC r254132:
erwin [Tue, 13 Aug 2013 06:25:17 +0000 (06:25 +0000)]
MFC r254132:
  Add empty zones for Shared Address Space (RFC 6598)

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

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

10 years agoMFC r252890, 252906, r252907, r253861, r254104:
pfg [Sun, 11 Aug 2013 02:53:18 +0000 (02:53 +0000)]
MFC r252890, 252906, r252907, r253861, r254104:

Implementation of the HTree directory index.

This is a port of NetBSD's GSoC 2012 Ext3 HTree directory indexing
by Vyacheslav Matyushin.  It was cleaned up and enhanced for FreeBSD
by Zheng Liu (lz@).

This is an excellent example of work shared among different projects:
Vyacheslav was able to look at an early prototype from Zheng Liu who
was also able to check the code from Haiku (with permission).

As in linux, the feature is not available by default and must be
enabled explicitly with tune2fs. We still do not support the
workarounds required in readdir for NFS.

Submitted by: Zheng Liu
Tested by: Mike Ma
Sponsored by: Google Inc.

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

10 years agoMFC: r253926
smh [Sun, 11 Aug 2013 01:14:46 +0000 (01:14 +0000)]
MFC: r253926

zfs_ioc_rename should not leave the value of zc_name passed in via zc altered
on return.

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

10 years agoMFC: r251782, r251783, r253994
marius [Sat, 10 Aug 2013 00:06:56 +0000 (00:06 +0000)]
MFC: r251782, r251783, r253994

- Remove conflicting macros from SPARC64's atomic(9) header.
- Add MD (for now) atomic_store_acq_<type>() and use it in pmap_activate()
  to get the semantics when setting the PMAP right.

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

10 years agoMFC: r241374
marius [Sat, 10 Aug 2013 00:00:19 +0000 (00:00 +0000)]
MFC: r241374

Add an unified macro to deny ability from the compiler to reorder
instruction loads/stores at its will.
The macro __compiler_membar() is currently supported for both gcc and
clang, but kernel compilation will fail otherwise.

Reviewed by: bde, kib
Discussed with: dim, theraven

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