brooks [Sun, 12 May 2013 00:35:57 +0000 (00:35 +0000)]
MFC r250337
Work around the implementation of LIBRARIES_ONLY. It causes drti.o to
not be installed in /usr/lib32 on systems with compat-32 support.
This fix has two parts. First, the build is forced by linking drti.o
into a dummy internal library. Second, the object file is installed
manually in the LIBRARIES_ONLY case.
dim [Sat, 11 May 2013 21:23:55 +0000 (21:23 +0000)]
Pull in r178240 from upstream llvm trunk:
Section 24.2.2 of the C++ standard, [iterator.iterators], Table 106
requires that the return type of *r for all iterators r be reference,
where reference is defined in [iterator.requirements.general]/p11 as
iterator_traits<X>::reference, and X is the type of r.
But in CFG.h, the dereference operator of PredIterator and
SuccIterator return pointer, not reference.
Furthermore the nested type reference is value_type&, which is not
the type returned from operator*().
This patch simply makes the iterator::reference type value_type*,
which is what the operator*() returns, and then re-lables the return
type as reference.
From a functionality point of view, the only difference is that the
nested reference type is now value_type* instead of value_type&.
This enables building clang 3.2 with the newer version of libc++ that
was merged in r250514 (and which has stricter iterator requirements for
the vector member templates).
This is a direct commit to stable/9, since head has a complete import of
llvm/clang trunk, and there is no single commit to merge.
hrs [Sat, 11 May 2013 19:11:20 +0000 (19:11 +0000)]
MFC r250240:
- Fix exit status when ip6addrctl_verbose=yes [*]
- Use the absolute pathname for ip6addrctl.
- Use "install" instead of "add" to reduce the number of invocations.
mav [Sat, 11 May 2013 08:14:33 +0000 (08:14 +0000)]
MFC r249352:
Do not sent 120 TEST UNIT READY requests on generic NOT READY statuses.
Some failing disks tend to return vendor-specific ASC/ASCQ codes with
NOT READY sense key. It caused extremely long recovery attempts, repeating
these 120 TURs (it takes at least 1 minute) for every I/O request.
Instead of that use default error handling, doing just few retries.
mav [Sat, 11 May 2013 08:10:46 +0000 (08:10 +0000)]
MFC r250185:
Add IDs for HighPoint RocketRAID 640L/642L/644L -- new series of 4-port
6Gbps PCIe 2.0 x2 SATA controllers, based on Marvell 88SE9235 chips.
markj [Fri, 10 May 2013 21:08:53 +0000 (21:08 +0000)]
MFC r249257:
Add support for getting and setting BBU properties related to battery
relearning. Specifically, add subcommands to mfiutil(8) which allow the
user to set the BBU and autolearn modes when the firmware supports it,
and add a subcommand which kicks off a battery relearn.
markj [Fri, 10 May 2013 20:55:39 +0000 (20:55 +0000)]
MFC r248776:
Fix interval-based rotations when the -t flag is used. In this case, find
the most-recently archived logfile and use its mtime to determine whether
or not to rotate, as in the non-timestamped case.
Previously we would just try to use the mtime of <logfile>.0, which always
results in a rotation since it generally doesn't exist in the -t case.
asomers [Fri, 10 May 2013 16:48:21 +0000 (16:48 +0000)]
MFC r249951
According to devctl(4), clients must read events whole; they may not piece them
together from multiple reads(). It's as if /dev/devctl is a datagram device
instead of a stream device. However, devd's internal buffer was too small
(1025 bytes) to read an entire ereport.fs.zfs.checksum event (variable, up to
~1300 bytes). This commit enlarges the buffer to 8k.
bdrewery [Fri, 10 May 2013 15:56:34 +0000 (15:56 +0000)]
MFC r249952:
Fix examples for overriding INSTALL to not suggest hardcoding
'install' since it breaks buildworld after the introduction and
use of 'install -l' in r245752. Overriding INSTALL causes
/usr/bin/install to be used instead of the proper
/usr/src/tools/install.sh which handles the new flag.
bdrewery [Fri, 10 May 2013 13:09:44 +0000 (13:09 +0000)]
MFC r249807,249893
Fix installkernel requiring users/groups defined in CHECK_UIDS
and CHECK_GIDS to exist since r152680. This is only needed for
installworld. The documented procedure of running mergemaster -p
to check for missing users is only needed for installworld, not
for installkernel. This fixes auditdistd incorrectly being
required for installkernel.
trociny [Wed, 8 May 2013 18:39:12 +0000 (18:39 +0000)]
MFC r249487:
Re-factor the code to provide kern_proc_filedesc_out(), kern_proc_out(),
and kern_proc_vmmap_out() functions to output process kinfo structures
to sbuf, to make the code reusable.
The functions are going to be used in the coredump routine to store
procstat info in the core program header notes.
hiren [Wed, 8 May 2013 16:43:52 +0000 (16:43 +0000)]
MFC: 233569
Fix crash on VirtualBox (and probably on some real hardware):
- Do not cover error returned by pmc_core_initialize with the
result of pmc_uncore_initialize, fail right away.
- Give a user something to report instead failing silently.
sbruno [Wed, 8 May 2013 15:47:51 +0000 (15:47 +0000)]
MFC r249815
Return a lun count of 1 and a lun id of 0 when CAM attempts a REPORT_LUNS
command on a disk device. This quieseces some noise on the console that
recently appeared.
kib [Wed, 8 May 2013 10:14:46 +0000 (10:14 +0000)]
MFC r250153:
Partially saved extended state must be handled always, i.e. for both
fpu-owned context, and for pcb-saved one. More, the XSAVE could do
partial save, same as XSAVEOPT, so qualifier for the handler should be
use_xsave and not use_xsaveopt.
Since xsave_area_desc is now needed regardless of the XSAVEOPT use,
remove the write-only use_xsaveopt variable.
kib [Wed, 8 May 2013 10:11:31 +0000 (10:11 +0000)]
MFC r250152:
The check to ensure that xstate_bv always has XFEATURE_ENABLED_X87 and
XFEATURE_ENABLED_SSE bits set is not needed. CPU correctly handles
any bitmask which is subset of the enabled bits in %XCR0.
More, CPU instructions XSAVE and XSAVEOPT could write the mask without
e.g. XFEATURE_ENABLED_SSE, after the VZEROALL. The check prevents the
restoration of the otherwise valid FPU save area.
kib [Tue, 7 May 2013 09:47:12 +0000 (09:47 +0000)]
MFC r249811:
Literally follow POSIX:
If the bs= expr operand is specified and no conversions other than sync,
noerror, or notrunc are requested, the data returned from each input
block shall be written as a separate output block.
trociny [Mon, 6 May 2013 20:58:02 +0000 (20:58 +0000)]
MFC r249486:
Re-factor coredump routines. For each type of notes an output
function is provided, which is used either to calculate the note size
or output it to sbuf. On the first pass the notes are registered in a
list and the resulting size is found, on the second pass the list is
traversed outputing notes to sbuf. For the sbuf a drain routine is
provided that writes data to a core file.
The main goal of the change is to make coredump to write notes
directly to the core file, without preliminary preparing them all in a
memory buffer. Storing notes in memory is not a problem for the
current, rather small, set of notes we write to the core, but it may
becomes an issue when we start to store procstat notes.
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.
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.
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.
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.
* 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.
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.
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.
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.
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)
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.
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).
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
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.
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.
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.
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.
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>
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
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.
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.
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.