jfv [Thu, 28 Feb 2013 08:19:55 +0000 (08:19 +0000)]
Remove DEV_NETMAP from stable/8 options, this was suggested
and approved by the owner, although there is code in some
drivers in support of it, the feature itself is not fully
supported in this release.
jfv [Thu, 28 Feb 2013 00:22:04 +0000 (00:22 +0000)]
MFC of the E1000 drivers to STABLE/8, this includes the follow revisions
plus a few tweaks:
196969,196970,211516,214646,215781,215789,215808,215910,223350,
223482,223831,228281,228393,229939,231796,232238,234665,235256,
236406,238148,238151,238214,238765,238770,238953,238981,239105,
239109,239304,240518,240693,240968,241037,241856,241885,243570,
243857,245334,246128,246482,247064
jhb [Wed, 27 Feb 2013 21:03:19 +0000 (21:03 +0000)]
MFC 240692,241228:
Adjust the ioctl workaround from r234501:
- Ensure the native ioctl path always allocates a 4kb buffer if a request
uses a buffer size of 0.
- Rounding all small requests up to 32k swamped the controller causing
firmware hangs. Instead, round requests smaller than 64k up to the next
power of 2 as a general rule. To handle the one known special case of a
command that accepts a 12k buffer returning a 24k-ish reply, round
requests between 8k and 16k up to 32k rather than 16k. The result is
that commands less than 8k should now be rounded up to a smaller size
(either 4k or 8k) rather than 32k.
jhb [Wed, 27 Feb 2013 19:38:33 +0000 (19:38 +0000)]
MFC 240474:
- Denote PCI-e endpoints that support FLR.
- Make parsing of PCI-e extended capabilities assume that future version
numbers are backwards compatible.
- Add new AER error descriptions.
- Add descriptions for more PCI-e extended capabilities.
jhb [Tue, 26 Feb 2013 21:05:06 +0000 (21:05 +0000)]
MFC 240467:
Ignore stop and continue signals sent to an exiting process. Stop signals
set p_xstat to the signal that triggered the stop, but p_xstat is also
used to hold the exit status of an exiting process. Without this change,
a stop signal that arrived after a process was marked P_WEXIT but before
it was marked a zombie would overwrite the exit status with the stop signal
number.
jhb [Tue, 26 Feb 2013 19:14:29 +0000 (19:14 +0000)]
MFC 239356,239564:
Teach dhclient to track changes in link state and to enter the reboot
state when the link on an interface goes up causing dhclient to attempt
to renew its existing lease.
jhb [Tue, 26 Feb 2013 16:55:59 +0000 (16:55 +0000)]
MFC 234927:
- Don't log messages saying that accounting is being disabled and enabled
if the accounting log file is atomically replaced with a new file
(such as during log rotation).
- Simplify accounting log rotation a bit. There is no need to re-run
accton(8) after renaming the new log file to it's real name.
mav [Thu, 21 Feb 2013 17:00:37 +0000 (17:00 +0000)]
MFC r238379, r238382 (by bruefer):
Renamed the kern.cam.da.da_send_ordered sysctl and tunable to
kern.cam.da.send_ordered, more in line with the other da sysctls/tunables.
Renamed the kern.cam.ada.ada_send_ordered sysctl and tunable to
kern.cam.ada.send_ordered, more in line with the other da sysctls/tunables.
hselasky [Thu, 21 Feb 2013 08:21:14 +0000 (08:21 +0000)]
MFC r246616 and r246759:
- Move scratch data from the USB bus structure to the USB device
structure so that simultaneous access cannot happen. Protect scratch
area using the enumeration lock.
- Reduce stack usage in usbd_transfer_setup() by moving some big stack
members to the scratch area. This saves around 200 bytes of stack.
- Fix a whitespace.
- Protect control requests using the USB device enumeration lock.
- Make sure all callers of usbd_enum_lock() check the return value.
- Remove the control transfer specific lock.
- Bump the FreeBSD version number, hence external USB modules may need
to be recompiled due to a USB device structure change.
markj [Tue, 19 Feb 2013 16:40:16 +0000 (16:40 +0000)]
MFC r239672 (by rrs):
This small change takes care of a race condition
that can occur when both sides close at the same time.
If that occurs, without this fix the connection enters
FIN1 on both sides and they will forever send FIN|ACK at
each other until the connection times out. This is because
we stopped processing the FIN|ACK and thus did not advance
the sequence and so never ACK'd each others FIN. This
fix adjusts it so we *do* process the FIN properly and
the race goes away ;-)
markj [Sun, 17 Feb 2013 19:49:29 +0000 (19:49 +0000)]
MFC r245961 r245962 r245963.
MFC r245961:
When the 'R' flag is used with a newsyslog.conf entry, some fields of
the corresponding struct sigwork_entry were left uninitialized,
potentially causing an early return from do_sigwork(). Ensure that these
fields are initialized, and handle the 'R' flag properly in
do_sigwork().
MFC r245962:
Ensure that newsyslog -n prints the correct message for a rotation rule
that uses the 'R' flag.
MFC r245963:
Rename the run_cmd field to sw_runcmd to make it consistent with the
other fields in struct sigwork_entry.
hselasky [Thu, 14 Feb 2013 11:25:07 +0000 (11:25 +0000)]
MFC r246397:
Make sure that all mouse buttons are released when clients
using /dev/consolectl close. This fixes a problem where if
a USB mouse is detached while a button is pressed, that
button is never released.
yongari [Wed, 13 Feb 2013 00:47:47 +0000 (00:47 +0000)]
MFC r246341:
Rework jumbo frame handling. QAC confirmed that the controller
requires 8 bytes alignment on RX buffer. Given that non-jumbo
frame works on any alignments I guess this DMA limitation for RX
buffer could be jumbo frame specific one. Also I'm not sure
whether this DMA limitation is related with 64bit DMA. Previously
age(4) disabled 64bit DMA addressing due to silent data corruption.
So we may need more testing on re-enabling 64bit DMA in future.
While I'm here, change mbuf chaining algorithm to use fixed sized
buffer and force software checksum if controller reports length
error. According to QAC, RFD is not updated at all for jumbo frame
so it works just like alc(4) controllers. This change also added
alignment fixup for strict alignment architectures. Because I'm
not aware of any non-x86 machines that use age(4) controllers it's
just for completeness at this moment.
Wit this change, jumbo frame should work with age(4).
cperciva [Sun, 10 Feb 2013 17:50:56 +0000 (17:50 +0000)]
MFC r246016:
Add a loader tunable "hw.broken_txfifo" which enables a workaround for a
bug in old versions of QEMU (and Xen, and other places using QEMU code).
delphij [Sat, 9 Feb 2013 01:41:21 +0000 (01:41 +0000)]
MFC r245264:
The current ZFS code expects ddt_zap_count to always succeed by asserting
the underlying zap_count() to return no errors. However, it is possible
that the pool reaches to such a state where zap_count would return error,
leading to panics when a pool is imported.
This commit changes the ddt_zap_count to return error returned from
zap_count and handle the error appropriately. With this change, it's now
possible to let zpool rollback damaged transaction groups and import the
pool.
delphij [Sat, 9 Feb 2013 01:38:43 +0000 (01:38 +0000)]
MFC r222950 (gibbs):
Remove C constructs that are incompatible with C++ from various
OpenSolaris and ZFS header files. These changes are sufficient
to allow a C++ program to use the libzfs library.
Note: The majority of these files already included 'extern "C"'
declarations, so the intention of providing C++ compatibility
already existed even if it wasn't provided.
cddl/compat/opensolaris/include/assert.h:
Wrap our compatibility assert implementation in
'extern "C"'. Since this is a compatibility header
I matched the Solaris style of doing this explicitly
rather than rely on FreeBSD's __BEGIN/END_DECLS macro.
sys/cddl/compat/opensolaris/sys/kstat.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h:
Rename parameters in function declarations that conflict
with C++ keywords. This was the solution preferred by
members of the Illumos community.
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h:
In C, nested structures are visible in the global namespace,
but in C++, they take on the namespace of the structure in
which they are contained. Flatten nested structure
definitions within struct zfs_cmd so these structures are
visible in the global namespace when compiled in both
languages.
kib [Fri, 8 Feb 2013 11:17:47 +0000 (11:17 +0000)]
MFC r246218:
Backup FATs were sometimes marked dirty by copying their first block
from the primary FAT, and then they were not marked clean on unmount.
Force marking them clean when appropriate.
pluknet [Thu, 7 Feb 2013 11:09:16 +0000 (11:09 +0000)]
MFC r226043 (manually):
Remove assertion against empty NFSv4 ACLs. An empty ACL is not exactly
valid - we don't allow for setting it on a file, for example - but it's
not something we should assert on.
For STABLE kernel, it changes nothing, because it's not compiled with
INVARIANTS. If it was, it would fix crashes. It also fixes an assert
in libc encountered with NFSv4 without nfsuserd(8) running.
mav [Wed, 6 Feb 2013 18:41:12 +0000 (18:41 +0000)]
MFC r242175:
Remove priority enforcement from xpt_ation(). It is not good and even not
safe in some cases to reduce CCB priority after it was scheduled with high
priority. This fixes reproducible deadlock when command sent through the
pass interface while ATA XPT recovers from command timeout.
Instead of that enforce priority at passioctl(). libcam provides no obvious
interface to specify CCB priority and so much (all?) code specifies zero
(highest) priority. This change limits pass CCBs priority to NORMAL run
level, allowing XPT to complete bus and device recovery after reset before
running any payload.
delphij [Tue, 5 Feb 2013 09:53:32 +0000 (09:53 +0000)]
MFC r243779 (marcel):
Protect against DoS attacks, such as being described in CVE-2010-2632.
The changes were derived from what has been committed to NetBSD, with
modifications. These are:
1. Preserve the existsing GLOB_LIMIT behaviour by including the number
of matches to the set of parameters to limit.
2. Change some of the limits to avoid impacting normal use cases:
GLOB_LIMIT_STRING - change from 65536 to ARG_MAX so that glob(3)
can still provide a full command line of expanded names.
GLOB_LIMIT_STAT - change from 128 to 1024 for no other reason than
that 128 feels too low (it's not a limit that impacts the
behaviour of the test program listed in CVE-2010-2632).
GLOB_LIMIT_PATH - change from 1024 to 65536 so that glob(3) can
still provide a fill command line of expanded names.
3. Protect against buffer overruns when we hit the GLOB_LIMIT_STAT or
GLOB_LIMIT_READDIR limits. We append SEP and EOS to pathend in
those cases. Return GLOB_ABORTED instead of GLOB_NOSPACE when we
would otherwise overrun the buffer.
This change also modifies the existing behaviour of glob(3) in case
GLOB_LIMIT is specifies by limiting the *new* matches and not all
matches. This is an important distinction when GLOB_APPEND is set or
when the caller uses a non-zero gl_offs. Previously pre-existing
matches or the value of gl_offs would be counted in the number of
matches even though the man page states that glob(3) would return
GLOB_NOSPACE when gl_matchc or more matches were found.
The limits that cannot be circumvented are GLOB_LIMIT_STRING and
GLOB_LIMIT_PATH all others can be crossed by simply calling glob(3)
again and with GLOB_APPEND set.
The entire description above applies only when GLOB_LIMIT has been
specified of course. No limits apply when this flag isn't set!
delphij [Tue, 5 Feb 2013 09:50:33 +0000 (09:50 +0000)]
MFC r243758 (marcel):
In globextend() when the pathv vector cannot be (re-)allocated, don't
free and clear the gl_pathv pointer in the glob_t structure. Such
breaks the invariant of the glob_t structure, as stated in the comment
right in front of the globextend() function. If gl_pathv was non-NULL,
then gl_pathc was > 0. Making gl_pathv a NULL pointer without also
setting gl_pathc to 0 is wrong.
Since we otherwise don't free the memory associated with a glob_t in
error cases, it's unlikely that this change will cause a memory leak
that wasn't already there to begin with. Callers of glob(3) must
call globfree(3) irrespective of whether glob(3) returned an error
or not.
MFC r243759 (marcel):
In globextend(), take advantage of the fact that realloc(NULL, size) is
equivalent to malloc(size). This eliminates the conditional expression
used for calling either realloc() or malloc() when realloc() will do
all the time.
eadler [Sat, 2 Feb 2013 23:22:39 +0000 (23:22 +0000)]
MFC r244122:
Remove 'dangerous' instructions from the example make.conf.
Clarify when and why these might be used and that this isn't a supported
configuration.
pluknet [Fri, 1 Feb 2013 15:48:29 +0000 (15:48 +0000)]
MFC r200596 (by imp):
Add NO_KERNELOBJ flag, similar to NO_KERNEL{CONFIG,DEPEND,CLEAN},
which disables doing a make obj. Use it when you know it will work
only. KERNFAST now implies NO_KERNELOBJ, since you don't need to keep
doing obj when doing incremental kernel builds.
delphij [Fri, 1 Feb 2013 07:38:26 +0000 (07:38 +0000)]
MFC r244568:
- Reduce buffer size from LINE_MAX to PATH_MAX, there is no point to store
path longer than this.
- Fix an unreached case of check against sizeof buf, which in turn leads
to an off-by-one nul byte write on the stack. The original condition
can never be satisfied because the passed boundary is the maximum value
that can be returned, so code was harmless.
mav [Thu, 31 Jan 2013 22:31:25 +0000 (22:31 +0000)]
MFC r245423, r245425, r245433:
- Print some more metadata fields.
- Small cosmetic tuning of the IRRT status constants.
- Keep value of orig_config_id metadata field. Windows driver writes there
previous value of config_id when it is changed in some cases. I guess it
may be used do avoid some split-brain conditions.
mav [Thu, 31 Jan 2013 22:27:31 +0000 (22:27 +0000)]
MFC r245400:
Windows driver writes relative volume IDs to metadata field. Use that value
as a hint for raid/rX device number to make it persistent across reboots.
mav [Thu, 31 Jan 2013 22:24:46 +0000 (22:24 +0000)]
MFC r245398:
- Add checks for Intel metadata version and attributes. Ignore disks with
unsupported metadata types like Intel Smart Response to not corrupt them.
- Improve setting of these things during metadata writing to protect from
incapable BIOS'es and other implementations.
mav [Thu, 31 Jan 2013 22:22:22 +0000 (22:22 +0000)]
MFC r245363:
Improve support for disabled disks. If disabled disk disconnected and then
reconnected back, leave it as disabled. If new disk inserted instead of
disabled, rebuild it and leave as enabled.
mav [Thu, 31 Jan 2013 22:19:39 +0000 (22:19 +0000)]
MFC r245341:
Windows handles INIT and VERIFY as array-wide and it doesn't specify which
disks should be rebuilt. Our rebuild code is same time disk-centric. To
handle this situation properly check all disks for RBLD flags, and if no
disk specified try rebuild/resync all of them except newly inserted.
mav [Thu, 31 Jan 2013 22:16:52 +0000 (22:16 +0000)]
MFC r245338:
Implement migration from single disk to RAID1/IRRT for Intel metadata.
Windows driver uses such migration when it creates new arrays. While GEOM
RAID has no mechanism to implement migration in general case, this specifc
case still can be handled easily via degraded RAID1 creation followed by
regular rebuild.
mav [Thu, 31 Jan 2013 22:13:36 +0000 (22:13 +0000)]
MFC r245326:
Add basic support for Intel Rapid Recover Technology (Intel RRT).
It is alike to RAID1, but with dedicating master and recovery disks and
providing manual control over synchronization. It allows to use recovery
disk as snapshot of the master disk from the time of the last sync.
This implementation is not functionaly complete comparing to Windows,
but it is better then silent conversion to RAID1 on first boot.
mav [Thu, 31 Jan 2013 21:26:02 +0000 (21:26 +0000)]
MFC r245519:
Recalculate volume size only for real CONCATs. For SINGLE trust volume
size given by metadata, as it should be correct and in some cases can be
smaller then subdisk size.
sbruno [Thu, 31 Jan 2013 20:32:11 +0000 (20:32 +0000)]
MFC r245459
Satisfy the intent of kern/151564: [ciss] ciss(4) should increase
CISS_MAX_LOGICAL to 107
Submitter wanted to increase the number of logical disks supported by ciss(4)
by simply raising the CISS_MAX_LOGICAL value even higher. Instead, consult
the documentation for the raid controller (OPENCISS) and poke the controller
bits to ask it for how many logical/physical disks it can handle.
Revert svn R242089 that raised CISS_MAX_LOGICAL to 64 for all controllers.
For older controllers that don't support this mechanism, fallback to the old
value of 16 logical disks. Tested on P420, P410, P400 and 6i model ciss(4)
controllers.
This should will be MFC'd back to stable/9 stable/8 and stable/7 after the MFC
period.
mav [Tue, 29 Jan 2013 17:47:07 +0000 (17:47 +0000)]
MFC r245444:
Alike to r242314 for GRAID make GRAID3 more aggressive in marking volumes
as clean on shutdown and move that action from shutdown_pre_sync stage to
shutdown_post_sync to avoid extra flapping.
ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID3
to shutdown gracefully. To handle that, mark volume as clean just when
shutdown time comes and there are no active writes.
mav [Tue, 29 Jan 2013 17:22:53 +0000 (17:22 +0000)]
MFC r245443:
Alike to r242314 for GRAID make GMIRROR more aggressive in marking volumes
as clean on shutdown and move that action from shutdown_pre_sync stage to
shutdown_post_sync to avoid extra flapping.
ZFS tends to not close devices on shutdown, that doesn't allow GEOM MIRROR
to shutdown gracefully. To handle that, mark volume as clean just when
shutdown time comes and there are no active writes.
marius [Mon, 28 Jan 2013 00:31:55 +0000 (00:31 +0000)]
MFC: r245923
- Check the return value of taskqueue_start_threads().
- At least the Saturn chips of 501-6738 cards need a delay after freezing
the external GMII pins before the internal PHY is accessible again. So
wait a bit after (un)freezing these. Also don't touch the other bits of
that configuration register. [1]
- Take advantage of nitems().
marius [Sun, 27 Jan 2013 23:21:51 +0000 (23:21 +0000)]
MFC: r245850
Revert the part of r239864 (MFC'ed to stable/8 in r241690) which removed
obtaining the SMP mutex around reading registers from other CPUs. As it
turns out, the hardware doesn't really like concurrent IPI'ing causing
adverse effects. Also the thought deadlock when using this spin lock here
and the targeted CPU(s) are also holding or in case of nested locks can't
actually happen. This is due to the fact that on sparc64, spinlock_enter()
only raises the PIL but doesn't disable interrupts completely. Thus direct
cross calls as used for the register reading (and all other MD IPI needs)
still will be executed by the targeted CPU(s) in that case.
marius [Sun, 27 Jan 2013 23:02:35 +0000 (23:02 +0000)]
MFC: r244991
- Replace partially incorrect function names in panic(9) strings with
__func__ and add some missing ones.
- Remove a stale comment.
- Remove unused NUM_ELEMENTS macro.
- Remove extra empty lines.
- Use DEVMETHOD_END.
- Use NULL rather than 0 for pointers.
marius [Sun, 27 Jan 2013 23:00:01 +0000 (23:00 +0000)]
MFC: r244990 (partial)
- Replace incorrect function names in printf(9) strings with __func__.
- Make xctrl_shutdown_reasons table const.
- Use nitems() rather than rolling an own version.
- Use DEVMETHOD_END.
- Use NULL rather than 0 for pointers.