mav [Mon, 17 Jun 2013 14:56:49 +0000 (14:56 +0000)]
MFC r251661:
Replicate r242422 from ata(4) to mvs(4):
Only four specific ATA PIO commands transfer several sectors per DRQ block
(interrupt). All other ATA PIO commands transfer one sector or 512 bytes
at one time. Hardcode these exceptions in mvs(4).
This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`.
Also it fixes timeout of DOWNLOAD_MICROCODE on `camcontrol fwdownload`.
yongari [Mon, 17 Jun 2013 04:42:02 +0000 (04:42 +0000)]
MFC r251600:
Avoid unnecessary controller reinitialization by checking driver
running state. fxp(4) requires controller reinitialization for the
following cases.
o RX lockup condition on i82557
o promiscuous mode change
o multicast filter change
o WOL configuration
o TSO/VLAN hardware tagging/checksum offloading configuration
o MAC reprogramming after speed/duplex/flow-control resolution
o Any events that result in MAC reprogramming(link UP/DOWN,
remote link partner's restart of auto-negotiation etc)
o Microcode loading/unloading
Apart from above cases which come from hardware limitation, upper
stack also blindly reinitializes controller whenever an IP address
is assigned. After r194573, fxp(4) no longer needs to reinitialize
the controller to program multicast filter after upping the
interface. So keeping track of driver running state should remove
all unnecessary controller reinitializations.
This change will also address endless controller reinitialization
triggered by dhclient(8).
rmacklem [Sat, 15 Jun 2013 01:35:52 +0000 (01:35 +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.
jhb [Fri, 14 Jun 2013 22:06:45 +0000 (22:06 +0000)]
MFC 250220:
Fix FIONREAD on regular files. The computed result was being ignored and
it was being passed down to VOP_IOCTL() where it promptly resulted in
ENOTTY due to a missing else for the past 8 years. While here, use a
shared vnode lock while fetching the current file's size.
Merge libzfs_core, zfs deadman thread and other ZFS bugfixes and improvements.
MFC r246619:
Correct spelling of "daemon". No .Dd bump.
Noticed by: Nathan Rich <Nathan.Rich dynastysystems com>
MFC r247187:
Import vendor change to avoid "unitialized variable" warnings.
Illumos ZFS issues:
3522 zfs module should not allow uninitialized variables
MFC r247265:
Merge the ZFS I/O deadman thread from vendor (illumos).
This feature panics the system on hanging ZFS I/O, helps debugging
and resumes failed service.
The panic behavior can be controlled with the loader-only tunables:
vfs.zfs.deadman_enabled (enable or disable panic on stalled ZFS I/O)
vfs.zfs.deadman_synctime (expiration time for stalled ZFS I/O)
By default, ZFS I/O deadman is enabled by default on amd64 and i386
excluding virtual guest machines.
MFC r247348:
Be more verbose on ZFS deadman I/O panic
Patch suggested upstream.
MFC r247398:
Import metaslab_sync() speedup from vendor (illumos).
Illumos ZFS issues:
3552 condensing one space map burns 3 seconds of CPU in spa_sync() thread
3564 spa_sync() spends 5-10% of its time in metaslab_sync() (when not
condensing)
3578 transferring the freed map to the defer map should be constant time
3579 ztest trips assertion in metaslab_weight()
MFC r247540:
Fix the zfs_ioctl compat layer to support zfs_cmd size change introduced
in r247265 (ZFS deadman thread). Both new utilities now support the old
kernel and new kernel properly detects old utilities.
For future backwards compatibility, the vfs.zfs.version.ioctl read-only
sysctl has been introduced. With this sysctl zfs utilities will be able
to detect the ioctl interface version of the currently loaded zfs module.
MFC r247585:
Merge new read-only zfs properties from vendor (illumos)
Illumos ZFS issues:
3588 provide zfs properties for logical (uncompressed) space used and
referenced
MFC r248265:
Update zfs.8 manpage date (missing in r247585)
MFC r248267:
Import minor ZFS changes from vendor
Illumos ZFS issues:
3604 zdb should print bpobjs more verbosely (fix zdb hang)
3606 zpool status -x shouldn't warn about old on-disk format
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.
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 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.
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
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
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
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
jhb [Fri, 14 Jun 2013 18:42:08 +0000 (18:42 +0000)]
MFC 249767:
- Some BIOSes use an Extended IRQ resource descriptor in _PRS for a link
that uses non-ISA IRQs but use a plain IRQ resource in _CRS. However,
a non-ISA IRQ can't fit into a plain IRQ resource. If we encounter a
link like this, build the resource buffer from _PRS instead of _CRS.
- Set the correct size of the end tag in a resource buffer.
rmacklem [Fri, 14 Jun 2013 00:33:55 +0000 (00:33 +0000)]
MFC: r250177
Fix the getpwnam_r() call in the pname_to_uid() kerberos library function so
that it handles the ERANGE error return case. Without this fix, authentication
of users for certain system setups could fail unexpectedly.
rmacklem [Fri, 14 Jun 2013 00:30:11 +0000 (00:30 +0000)]
MFC: r250176
Fix the getpwuid_r() call in the gssd daemon so that it handles
the ERANGE error return case. Without this fix, authentication
of users for certain system setups could fail unexpectedly.
rmacklem [Fri, 14 Jun 2013 00:02:29 +0000 (00:02 +0000)]
MFC: r251089
Add a patch analygous to r248567, r248581, r251079 to the
old NFS client to avoid the panic reported in the PR by
doing the vnode_pager_setsize() call after unlocking the mutex.
jhb [Thu, 13 Jun 2013 21:01:33 +0000 (21:01 +0000)]
MFC 249315:
Proxy allocation requests for the PCI ROM BAR from child devices similar
to how the VGA bus driver currently proxies allocation requests for other
PCI BARs.
markj [Sun, 9 Jun 2013 17:47:16 +0000 (17:47 +0000)]
MFC r247221:
Merge part of r1712 from elftoolchain, making it possible to resize ELF
sections and indirectly change the layout of an ELF file when
ELF_F_LAYOUT is not set.
markj [Sat, 8 Jun 2013 15:46:09 +0000 (15:46 +0000)]
MFC r235647 for newsyslog (by gleb):
Hide DIR definition by making it an opaque struct typedef.
Introduce dirfd() libc exported symbol replacing macro with same name,
preserve _dirfd() macro for internal use.
Replace dirp->dd_fd with dirfd() call. Avoid using dirfd as variable
name to prevent shadowing global symbol.
MFC r250545:
Some filesystems (NFS in particular) do not fill out the d_type field when
returning directory entries through readdir(3). In this case we need to
obtain the file type ourselves; otherwise newsyslog -t will not be able to
find archived log files and will fail to both delete old log files and to
do interval-based rotations properly.
MFC r251240:
We want to stat the archived log file rather than the logfile itself.
obrien [Fri, 7 Jun 2013 21:39:46 +0000 (21:39 +0000)]
MF9: r237968, r251504:
MFC: r251368, r251382: Match the options of the kernel.
MFC: r237279: install filemon.h into /usr/include for userland consumption.
smh [Fri, 7 Jun 2013 12:24:15 +0000 (12:24 +0000)]
Enhanced BIO_DELETE support for CAM SCSI to add ATA_TRIM support.
Disable CAM BIO queue sorting for non-rotating media by default.
MFC r245253 Use sysctl tunable values for scsi_da & retry_count (stable/8 only)
MFC r249939 Added available delete methods discovery during device probe
MFC r249941 Automatically disable BIO queue sorting for non-rotating media
MFC r250033 Correct comment typo's
MFC r250179 Update probe flow so that devices with lbp can also disable disksort
MFC r250181 Check for ATA Information VPD before querying for ATA
MFC r250183 Enable CAM SCSI to choice ATA TRIM during autodetection
MFC r250967 Enforce validation on the selected delete method via sysctl
mav [Wed, 5 Jun 2013 18:49:28 +0000 (18:49 +0000)]
MFC r250286:
Some fixes to snd_envy24ht(4) driver:
- Allow DMA addresses anywhere in the lower 4GB; Envy24HT has a 32-bit DMA
engine, not 28-bit like Envy24.
- Mark interrupt handler as MPSAFE, seems to be correctly synchronized.
PR: kern/152378
Submitted by: Jason Harmening <jason.harmening@gmail.com>
kib [Mon, 3 Jun 2013 17:13:37 +0000 (17:13 +0000)]
MFC r251033:
When handling an exception from the attempt from loading the faulting
context on return from the trap handler, re-enable the interrupts on
i386 and amd64.
jhb [Mon, 3 Jun 2013 17:07:57 +0000 (17:07 +0000)]
MFC 248167:
Fix the 'C' field for a running thread to match the behavior described
in the manpage by having it display the current CPU (ki_oncpu) rather
than the previously used CPU (ki_lastcpu). ki_lastcpu is still used for
all other thread states.
jkim [Mon, 3 Jun 2013 16:47:46 +0000 (16:47 +0000)]
MFC: r251186
Fix a long standing logic bug introduced in r167814. The code was added to
get RSDP from loader(8) hint via kenv(2) but the bug nullified the new code
and we always fell back to the previous method, i. e., sysctlbyname(3).
jhb [Thu, 30 May 2013 19:24:29 +0000 (19:24 +0000)]
MFC 246417,247116,248584:
Rework the handling of stop signals in the NFS client. The changes in
195702, 195703, and 195821 prevented a thread from suspending while holding
locks inside of NFS by forcing the thread to fail sleeps with EINTR or
ERESTART but defer the thread suspension to the user boundary. However,
this had the effect that stopping a process during an NFS request could
abort the request and trigger EINTR errors that were visible to userland
processes (previously the thread would have suspended and completed the
request once it was resumed).
This change instead effectively masks stop signals while in the NFS client.
It uses the existing TDF_SBDRY flag to effect this since SIGSTOP cannot
be masked directly. Instead of setting PBDRY on individual sleeps, change
the VFS_*() and VOP_*() methods to defer stop signals for filesystems which
request this behavior via a new VFCF_SBDRY flag. Note that this has to be
a VFC flag rather than a MNTK flag so that it works properly with
VFS_MOUNT() when the mount is not yet fully constructed. For now, only the
NFS clients set this new flag in VFS_SET().
A few other related changes:
- Add an assertion to ensure that TDF_SBDRY doesn't leak to userland.
- When a lookup request uses VOP_READLINK() to follow a symlink, mark
the request as being on behalf of the thread performing the lookup
(cnp_thread) rather than using a NULL thread pointer. This causes
NFS to properly handle signals during this VOP on an interruptible
mount.
- Ignore thread suspend requests due to SIGSTOP if stop signals are
currently deferred. This can occur if a process is stopped via
SIGSTOP while a thread is running or runnable but before it has set
TDF_SBDRY.
markj [Wed, 29 May 2013 22:29:33 +0000 (22:29 +0000)]
Revert my previous merge. There's a variable name difference between head
and stable (dirfd vs. dir_fd) and I managed to get it wrong again when I
did the MFC, even after I tested.
markj [Wed, 29 May 2013 21:08:23 +0000 (21:08 +0000)]
MFC r250545:
Some filesystems (NFS in particular) do not fill out the d_type field when
returning directory entries through readdir(3). In this case we need to
obtain the file type ourselves; otherwise newsyslog -t will not be able to
find archived log files and will fail to both delete old log files and to
do interval-based rotations properly.
mav [Wed, 29 May 2013 04:18:02 +0000 (04:18 +0000)]
MFC r250508:
Disable sending Early R_OK on SiI3726/SiI3826 port multipliers.
With "cached read" HDD testing and multiple ports busy on a SATA
host controller, 3726/3826 PMP will very rarely drop a deferred
R_OK that was intended for the host. Symptom will be all 5 drives
under test will timeout, get reset, and recover.
mav [Wed, 29 May 2013 04:14:41 +0000 (04:14 +0000)]
MFC r250819:
Fix vdc->Secondary_Element_Count metadata field access from 16 to 8 bit.
In some cases it could cause kernel panic during failed drive replacement.
jhb [Tue, 28 May 2013 18:43:58 +0000 (18:43 +0000)]
MFC 247332:
Add a quirk to disable this driver for certain older laptops with an ICH2
southbridge and an Intel 82815_MC host bridge where the host bridge's
revision is less than 5
mckusick [Mon, 27 May 2013 22:41:43 +0000 (22:41 +0000)]
MFC of 250708:
Clean up trailing whitespace.
Submitted by: Andy Kosela
MFC of 250710: (delete addition of -k which does not exist in 8-stable)
When running the -m option to generate a newfs(8) command suitable for
recreating the filesystem, check for and output the -i, -k, and -l
options if appropriate.
Note the remaining deficiencies of the -m option in the dumpfs(8)
manual page. Specifically that newfs(8) options -E, -R, -S, and -T
options are not handled and that -p is not useful so is omitted.
Also document that newfs(8) options -n and -r are neither checked
for nor output but should be. The -r flag is needed if the filesystem
uses gjournal(8).
trociny [Sun, 26 May 2013 18:54:50 +0000 (18:54 +0000)]
MFC r250405:
Move snmp_hast manual to section 3, where all other manual pages for
bsnmp modules are located.
Section 3 (Library Functions) looks wrong for this manual page, which
contains only module description, that is why initially it was located
to section 8 (System Manager's Manual). On the other hand manual
pages for all other bsnmpd modules are already located in the section
3, and having all pages in one section looks more consistent. Also,
currently, similarly to manuals for other modules, snmp_hast manual
contains LIBRARY section, which is not good style for section 8.