gnn [Wed, 18 Jan 2012 21:54:34 +0000 (21:54 +0000)]
MFC: 229965
Fix for PR 138526.
Add the ability for /dev/null and /dev/zero to accept
being set into non blocking mode via fcntl(). This
brings the code into compliance with IEEE Std 1003.1-2001
as referenced in another PR, 94729.
truckman [Wed, 18 Jan 2012 21:49:37 +0000 (21:49 +0000)]
MFC: r229984
Pass the arguments to mtx_init() in the correct order. There should be
no change to the binary because the value of MTX_DEF is zero and there
is a visible function prototype.
gavin [Tue, 17 Jan 2012 13:52:04 +0000 (13:52 +0000)]
Merge r229085 from head:
Default to not performing the early-boot memory tests when we detect we
are booting inside a VM. There are three reasons to disable this:
o It causes the VM host to believe that all the tested pages or RAM are
in use. This in turn may force the host to page out pages of RAM
belonging to other VMs, or otherwise cause problems with fair resource
sharing on the VM cluster.
o It adds significant time to the boot process (around 1 second/Gig in
testing)
o It is unnecessary - the host should have already verified that the
memory is functional etc.
Note that this simply changes the default when in a VM - it can still be
overridden using the hw.memtest.tests tunable.
pho [Tue, 17 Jan 2012 11:04:58 +0000 (11:04 +0000)]
MFC: r228218, r228219, 228220, 228221
Rename copyin_timeout32 to umtx_copyin_timeout32 and move parameter
check here. Include check for negative seconds value.
Add umtx_copyin_timeout() and move parameter checks here.
Add declaration of umtx_copyin_timeout()
Use umtx_copyin_timeout() to copy and check timeout parameter.
kib [Tue, 17 Jan 2012 06:57:55 +0000 (06:57 +0000)]
MFC r229934:
Change the type of the paging_in_progress refcounter from u_short to
u_int. With the auto-sized buffer cache on the modern machines, UFS
metadata can generate more the 65535 pages belonging to the buffers
undergoing i/o, overflowing the counter.
To keep the layout of other fields of the struct vm_object intact
on stable/9, put enlarged paging_in_progress at the end of the structure,
and put a placeholder in the place of old pip counter.
kib [Tue, 17 Jan 2012 06:40:41 +0000 (06:40 +0000)]
MFC r229435:
Add special loader environment variables 'comconsole_port' and
'comconsole_pcidev'.
Change allows to use ISA serial ports other than COM1 for the
loader/kernel console without loader recompilation, and to configure
console on the PCI-attached UARTs.
pluknet [Mon, 16 Jan 2012 14:55:42 +0000 (14:55 +0000)]
MFC r228985,229881:
Unset the environment variables associated with individual menu items
before invoking the kernel.
Get rid of a spurious warning on the console when booting the kernel
from the interactive loader(8) prompt and beastie_disable="YES" is set
in loader.conf(5).
jhb [Fri, 13 Jan 2012 20:35:12 +0000 (20:35 +0000)]
MFC 229665,229672,229700:
Remove the assertion from tcp_input() that rcv_nxt is always greater
than or equal to rcv_adv and fix tcp_twstart() to handle this case by
assuming the last window was zero rather than a negative value.
The code in tcp_input() already safely handled this case. It can happen
due to delayed ACKs along with a remote sender that sends data beyond
the window we previously advertised. If we have room in our socket buffer
for the extra data beyond the advertised window, we will accept it.
However, if the ACK for that segment is delayed, then we will not
effectively fixup rcv_adv to account for that extra data until the
next segment arrives and forces out an ACK. When that next segment
arrives, rcv_nxt will be beyond rcv_adv.
jhb [Fri, 13 Jan 2012 20:28:11 +0000 (20:28 +0000)]
MFC 228961:
Further relax the strictness of enforcing allocations to only come from
decoded ranges. Pass any request for a specific range that fails because
it is not in a decoded range for an ACPI Host-PCI bridge up to the parent
to see if it can still be allocated. This is based on the assumption that
many BIOSes are inconsistent/broken and that settings programmed into BARs
or resources assigned to other built-in components are more trustworthy than
the list of decoded resource ranges in _CRS. This effectively limits the
decoded ranges to only being used for "wildcard" ranges when allocating
fresh resources for a BAR, etc. At some point I would like to only be
this permissive during an early scan of firmware-assigned resources during
boot and to be strict about all later allocations, but that isn't viable
currently.
jhb [Fri, 13 Jan 2012 20:25:38 +0000 (20:25 +0000)]
MFC 228960:
Cap the priority calculated from the current thread's running tick count
at SCHED_PRI_RANGE to prevent overflows in the priority value. This can
happen due to irregularities with clock interrupts under certain
virtualization environments.
jhb [Fri, 13 Jan 2012 20:15:27 +0000 (20:15 +0000)]
MFC 229429:
Some small fixes to CPU accounting for threads:
- Only initialize the per-cpu switchticks and switchtime in sched_throw()
for the very first context switch on APs during boot. This avoids a
small gap between the middle of thread_exit() and sched_throw() where
time is not accounted to any thread.
- In thread_exit(), update the timestamp bookkeeping to track the changes
to mi_switch() introduced by td_rux so that the code once again matches
the comment claiming it is mimicing mi_switch(). Specifically, only
update the per-thread stats directly and depend on ruxagg() to update
p_rux rather than adjusting p_rux directly. While here, move the
timestamp bookkeeping as late in the function as possible.
jhb [Fri, 13 Jan 2012 19:54:00 +0000 (19:54 +0000)]
MFC 229427:
Fix a few bugs in the SRAT parsing code:
- Actually increment ndomain when building our list of known domains
so that we can properly renumber them to be 0-based and dense.
- If the number of domains exceeds the configured maximum (VM_NDOMAIN),
bail out of processing the SRAT and disable NUMA rather than hitting an
obscure panic later.
- Don't bother parsing the SRAT at all if VM_NDOMAIN is set to 1 to
disable NUMA (the default).
jhb [Fri, 13 Jan 2012 19:50:52 +0000 (19:50 +0000)]
MFC 229390,229420,229479:
Fix some races in the multicast code by removing places where we would
drop the IF_ADDR_LOCK while walking an interface's multicast address list:
- Use TAILQ_FOREACH() instead of TAILQ_FOREACH_SAFE() for some loops that
do not modify the queues they iterate over.
- When cancelling multicast timers on an interface, don't release the
reference on a group in the leaving state while iterating over the loop.
Instead, use the same approach used in igmp_ifdetach() and mld_ifdetach()
of placing the groups to free on a pending release list and then releasing
the references after dropping the IF_ADDR_LOCK.
- Use the mli_relinmhead list normally used to defer calls to
in6m_release_locked() to defer calls to mld_v1_transmit_report() until
after the IF_ADDR_LOCK is dropped.
jhb [Fri, 13 Jan 2012 19:20:09 +0000 (19:20 +0000)]
MFC 229414,229476,229477:
Various fixes to the SIOC[DG]LIFADDR ioctl handlers:
- Grab a reference on any matching interface address (ifa) before dropping
the IF_ADDR_LOCK() and release the reference after using it to prevent a
potential use-after-free.
- Fix the IPv4 ioctl handlers in in_lifaddr_ioctl() to work with IPv4
interface addresses rather than IPv6.
- Add missing interface address list locking in the IPv4 handlers.
jhb [Fri, 13 Jan 2012 19:10:53 +0000 (19:10 +0000)]
MFC 229400:
Improve the cscope target's handling of MD directories. Automatically
include the MACHINE_CPUARCH directory if it differents from MACHINE when
building an index for a single machine. Also, include the 'x86' directory
when building an index for i386, pc98, or amd64.
jhb [Fri, 13 Jan 2012 18:53:48 +0000 (18:53 +0000)]
MFC 228849, 229727:
Add post-VOP hooks for VOP_DELETEEXTATTR() and VOP_SETEXTATTR() and use
these to trigger a NOTE_ATTRIB EVFILT_VNODE kevent when the extended
attributes of a vnode are changed.
jhb [Fri, 13 Jan 2012 18:49:04 +0000 (18:49 +0000)]
MFC 228738:
Allow boot0cfg to force a PXE boot via boot0 on the next boot.
- Fix boot0 to check for PXE when using the pre-set setting for the
preferred slice.
- Update boot0cfg to use slice 6 to select PXE. Accept a 'pxe' argument
instead of a number for the 's' option as a way to select PXE as well.
mckusick [Fri, 13 Jan 2012 07:19:02 +0000 (07:19 +0000)]
MFC: 228794
Reduce NFPI by half to keep the default number of inodes the same with
the now default 32K/4K filesystem the same as the number of inodes in
the previously default 16K/2K filesystem.
mckusick [Fri, 13 Jan 2012 07:08:21 +0000 (07:08 +0000)]
MFC: 226520
The current /etc/dumpdates file restricts device names to 32 characters.
With the addition of various GEOM layers some device names now exceed
this length, for example /dev/mirror/encrypted.elig.journal. This
change expands the field to 53 bytes which brings the /etc/dumpdates
lines to 80 characters. Exceeding 80 characters makes the /etc/dumpdates
file much less human readable. A test is added to dump so that it
verifies that the device name will fit in the 53 character field
failing the dump if it is too long.
This change has been checked to verify that its /etc/dumpdates file
is compatible with older versions of dump.
Reported by: Martin Sugioarto <martin@sugioarto.com>
PR: kern/160678
mav [Thu, 12 Jan 2012 15:56:17 +0000 (15:56 +0000)]
MFC r228461:
Fix few bugs in isp(4) target mode support:
- in destroy_lun_state() assert hold == 1 instead of 0, as it should
receive hold taken by the create_lun_state() or get_lun_statep() before;
- fix hold count leak inside rls_lun_statep() that also fired above assert;
- in destroy_lun_state() use SIM bus number instead of SIM path id for
ISP_GET_PC_ADDR(), as it was before r196008;
- make isp_disable_lun() to set status in CCB;
- make isp_target_mark_aborted() set status into the proper CCB.
mav [Thu, 12 Jan 2012 14:53:08 +0000 (14:53 +0000)]
MFC r228808, r228847, 229395:
r228808, r228847:
Make cd driver to handle Audio CDs, reporting their 2352 bytes sectors to
GEOM and using READ CD command for reading data, same as acd driver does.
Audio CDs identified by checking respective bit of the control field of
the first track in TOC.
229395:
Add support for CDRIOCGETBLOCKSIZE and CDRIOCSETBLOCKSIZE IOCTLs to control
sector size same as acd driver does. Together with r228808 and r228847 this
allows existing multimedia/vlc to play Audio CDs via CAM cd driver.
wblock [Thu, 12 Jan 2012 04:37:19 +0000 (04:37 +0000)]
MFC r227774, r227777, r227800, r229838, r229847:
MFC r227774:
Add a section that explicitly describes partitioning schemes. Modify
existing sections to refer to the new one. Rearrange partitioning
scheme list so MBR and EBR types are together. Also add several
corrections for grammar, clarity, and consistency.
MFC r227777:
Fix date.
MFC r227800:
Correct and expand BSD partitioning scheme description.
Correct GUID to GPT in RECOVERING section.
mav [Wed, 11 Jan 2012 18:12:53 +0000 (18:12 +0000)]
MFC r228726, r228727:
Cast some vendor-specific spell on VIA VT1708S codecs to:
- make analog input loopback work;
- get access to the mics boost controls.
rmacklem [Wed, 11 Jan 2012 01:24:35 +0000 (01:24 +0000)]
MFC: r228827
During investigation of an NFSv4 client crash reported by glebius@,
jhb@ spotted that nfscl_getstateid() might modify credentials when
called from nfsrpc_read() for the case where p != NULL, whereas
nfsrpc_read() only did a crdup() to get new credentials for p == NULL.
This bug was introduced by r195510, since pre-r195510 nfscl_getstateid()
only modified credentials for the p == NULL case. This patch modifies
nfsrpc_read()/nfsrpc_write() so that they do crdup() for the p != NULL case.
It is conceivable that this bug caused the crash reported by glebius@, but
that will not be determined for some time, since the crash occurred after
about 1month of operation.
kib [Tue, 10 Jan 2012 13:41:14 +0000 (13:41 +0000)]
MFC r229431:
Do the vput() for the lowervp in the null_nodeget() for error case too.
Several callers of null_nodeget() did the cleanup itself, but several
missed it, most prominent being null_bypass(). Remove the cleanup from
the callers, now null_nodeget() handles lowervp free itself.
dim [Tue, 10 Jan 2012 07:46:35 +0000 (07:46 +0000)]
MFC r229425:
In sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c, check the
the number of links against LINK_MAX (which is INT16_MAX), not against
UINT32_MAX. Otherwise, the constant would implicitly be converted to
-1.
dim [Tue, 10 Jan 2012 07:45:00 +0000 (07:45 +0000)]
MFC r229423:
In sys/dev/qlxgb/qla_misc.c, fix a copy/paste issue. Clang complained
the variable 'val' was uninitialized when used. Instead, 'sig' should
have been printed.
dim [Tue, 10 Jan 2012 07:42:01 +0000 (07:42 +0000)]
MFC r229402:
In sys/compat/linux/linux_ioctl.c, work around a warning when a pointer
is compared to an integer, by casting the pointer to l_uintptr_t. No
functional difference on both i386 and amd64.
dim [Tue, 10 Jan 2012 07:38:46 +0000 (07:38 +0000)]
MFC r229401:
In sys/dev/if_ndis/if_ndis_pccard.c, fix a bug where a garbage rid was
passed to resource_list_add(). The rid that was just returned by
bus_alloc_resource_any() should have been used instead.
hrs [Tue, 10 Jan 2012 07:21:11 +0000 (07:21 +0000)]
Add relnotes items:
RACCT resource accounting API,
RCTL resource limiting API and rctl(8),
sendmsg(2)/recvmsg(2) improvement in Linux compat layer,
open(2)/fhopen(2) O_CLOEXEC,
COMPAT_43 supports a.out binary on amd64,
usb_pf and usbdump(8),
cxgb(4) 7.11.0,
em(4) 7.3.2,
igb(4) 2.2.5,
OFED 1.5.3 imported to support Infiniband,
graid(8),
resolvconf(8) 3.4.4 imported,
hastd(8) source keyword,
ps(1) -o usertime, systime,
utmp(5) replaced by utmpx(3) [*],
GNU GCC updated to the last GPLv2-licensed version,
tzdata2011e,
add description about incompatibilities due to ATA_CAM.
rmacklem [Tue, 10 Jan 2012 02:16:38 +0000 (02:16 +0000)]
MFC: r228757
jwd@ reported a problem via email where the old NFS client would
get a reply of EEXIST from an NFS server when a Mkdir RPC was retried,
for an NFS over UDP mount.
Upon investigation, it was found that the client was retransmitting
the Mkdir RPC request over UDP, but with a different xid. As such,
the retransmitted message would miss the Duplicate Request Cache
in the server, causing it to reply EEXIST. The kernel client side
UDP rpc code has two timers. The first one causes a retransmit using
the same xid and socket and was set to a fixed value of 3seconds.
(The default can be overridden via CLSET_RETRY_TIMEOUT.)
The second one creates a new socket and xid and should be larger
than the first. However, both NFS clients were setting the second
timer to nm_timeo ("timeout=<value>" mount argument), which defaulted to
1second, so the first timer would never time out.
This patch fixes both NFS clients so that they set the first timer
using nm_timeo and makes the second timer larger than the first one.