]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agochown: Fix chown test number
eadler [Thu, 17 Jul 2014 06:57:26 +0000 (06:57 +0000)]
chown: Fix chown test number

9 years agounits(1): Add support for output-format
eadler [Thu, 17 Jul 2014 06:54:12 +0000 (06:54 +0000)]
units(1): Add support for output-format
Add support for the output-format argument.  This also exposes subtle
rounding differences between GNU units and our units.

9 years agoFix a typo.
hiren [Thu, 17 Jul 2014 06:21:58 +0000 (06:21 +0000)]
Fix a typo.

PR: 191898
Submitted by: vsjcfm@gmail.com

9 years agoOops - somehow I missed the IP option numbers clashing with the multicast
adrian [Thu, 17 Jul 2014 05:45:54 +0000 (05:45 +0000)]
Oops - somehow I missed the IP option numbers clashing with the multicast
numbers below.

Move them to a new set of non-clashing numbers.

9 years agoDeprecate m_act. Use m_nextpkt always.
kevlo [Thu, 17 Jul 2014 05:21:16 +0000 (05:21 +0000)]
Deprecate m_act.  Use m_nextpkt always.

9 years agoCorrect the name of the man page for pmap_ts_referenced().
alc [Wed, 16 Jul 2014 23:17:57 +0000 (23:17 +0000)]
Correct the name of the man page for pmap_ts_referenced().

Sponsored by: EMC / Isilon Storage Division

9 years agoNuke the never-used RF_TIMESHARE feature, reducing the complexity of the
truckman [Wed, 16 Jul 2014 22:18:19 +0000 (22:18 +0000)]
Nuke the never-used RF_TIMESHARE feature, reducing the complexity of the
code.  The consensus on arch@ is that this feature might have been useful
in the distant past, but is now just unnecessary bloat.

The int_rman_activate_resource() and int_rman_deactivate_resource()
functions become trivial, so manually inline them.

The special deferred handling of RF_ACTIVE is no longer needed in
reserve_resource_bound(), so eliminate the associated code at the
end of the function.

These changes reduce the object file size by more than 500 bytes on i386.

Update the rman.9 man page to reflect the removal of the RF_TIMESHARE
feature.

MFC after: 2 weeks

9 years agoRegen after r268778 to replace WITH_TESTS with WITHOUT_TESTS.
jmmv [Wed, 16 Jul 2014 21:43:24 +0000 (21:43 +0000)]
Regen after r268778 to replace WITH_TESTS with WITHOUT_TESTS.

9 years agoEnable MK_TESTS by default, take 2.
jmmv [Wed, 16 Jul 2014 21:40:11 +0000 (21:40 +0000)]
Enable MK_TESTS by default, take 2.

This is a redo of r267424, which was reverted in r267432 because it broke
"make buildworld" from FreeBSD 9.x.  This issue has been resolved and this
change is still "make tinderbox" clean.

9 years agoAdd emulation for legacy x86 task switching mechanism.
neel [Wed, 16 Jul 2014 21:26:26 +0000 (21:26 +0000)]
Add emulation for legacy x86 task switching mechanism.

FreeBSD/i386 uses task switching to handle double fault exceptions and this
change enables that to work.

Reported by: glebius

9 years agoImplement pmap_unwire(). See r268327 for the motivation behind this change.
alc [Wed, 16 Jul 2014 21:06:43 +0000 (21:06 +0000)]
Implement pmap_unwire().  See r268327 for the motivation behind this change.

9 years agoAfter r261991, clang warnings about unused functions in the kernel were
dim [Wed, 16 Jul 2014 20:37:03 +0000 (20:37 +0000)]
After r261991, clang warnings about unused functions in the kernel were
completely silenced.  Make sure these warnings appear again, so there is
some incentive to fix them, but do not error out the whole kernel build
for them.

Noticed by: steven@pyro.eu.org
PR: 191867
MFC after: 3 days

9 years agoRevert previous revision (r268461) for reasons documented in PR.
dteske [Wed, 16 Jul 2014 19:02:30 +0000 (19:02 +0000)]
Revert previous revision (r268461) for reasons documented in PR.
To use tmux in an rc.d script, use the new-session flag "-d".
To use screen in an rc.d script, use the "-dm" flag.
If you really need to launch an attached session, manually
export TERM=xterm (FreeBSD 9.0 or higher) or export TERM=cons25
for older releases.

Reported by: bdrewery
Discussed on: src-committers, svn-src-all, svn-src-head
PR: bin/191869

9 years agoAllow efifb to be used with xf86-video-scfb. This is important for EFI
nwhitehorn [Wed, 16 Jul 2014 18:52:21 +0000 (18:52 +0000)]
Allow efifb to be used with xf86-video-scfb. This is important for EFI
systems without either a CSM or real graphics drivers, such as my Lenovo
Haswell laptop.

This provides working X with the small complication of a console cursor
permanently overlaid on the upper-left corner of the screen that will be
dealt with later.

Also remove some redundant screen clearing.

9 years agoAllow console drivers active from early boot to be used with xf86-video-scfb,
nwhitehorn [Wed, 16 Jul 2014 18:49:46 +0000 (18:49 +0000)]
Allow console drivers active from early boot to be used with xf86-video-scfb,
rather than only drivers attached later on. This involves a small amount of
code duplication with dev/fb/fbd.c, which will fixed later on.

Also improve performance of vt_blank() by making it not read from the
framebuffer unnecessarily.

9 years agolibpythagoras needs libm.
jmmv [Wed, 16 Jul 2014 16:42:58 +0000 (16:42 +0000)]
libpythagoras needs libm.

This fixes "make tinderbox" failures on various architectures when
WITH_TESTS=yes is enabled.  Problem introduced in r267679.

9 years agoAdd support for VMWare dialect of EXTENDED COPY command, aka VAAI Clone.
mav [Wed, 16 Jul 2014 15:57:17 +0000 (15:57 +0000)]
Add support for VMWare dialect of EXTENDED COPY command, aka VAAI Clone.

This allows to clone VMs and move them between LUNs inside one storage
host without generating extra network traffic to the initiator and back,
and without being limited by network bandwidth.

LUNs participating in copy operation should have UNIQUE NAA or EUI IDs set.
For LUNs without these IDs VMWare will use traditional copy operations.

Beware: the above LUN IDs explicitly set to values non-unique from the VM
cluster point of view may cause data corruption if wrong LUN is addressed!

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

9 years agoDo not ignore error from tmpfs_alloc_vp(). It results in access to
kib [Wed, 16 Jul 2014 14:08:01 +0000 (14:08 +0000)]
Do not ignore error from tmpfs_alloc_vp().  It results in access to
the random memory.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoRemove unused header.
kib [Wed, 16 Jul 2014 14:06:16 +0000 (14:06 +0000)]
Remove unused header.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoCheck for the cross-device cross-link attempt in the VFS, instead of
kib [Wed, 16 Jul 2014 14:04:46 +0000 (14:04 +0000)]
Check for the cross-device cross-link attempt in the VFS, instead of
forcing filesystem VOP_LINK() methods to repeat the code.  In
tmpfs_link(), remove redundand check for the type of the source,
already done by VFS.

Note that NFS server already performs this check before calling
VOP_LINK().

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoSort properly the headers
bapt [Wed, 16 Jul 2014 13:52:05 +0000 (13:52 +0000)]
Sort properly the headers
While here space/tabs cleanup

Reviewed by: kib

9 years agoWhite space fixes
bapt [Wed, 16 Jul 2014 12:09:12 +0000 (12:09 +0000)]
White space fixes

9 years agoSort headers
bapt [Wed, 16 Jul 2014 11:41:28 +0000 (11:41 +0000)]
Sort headers
Constify long options
Remove useless call to sigemptyset
properly check errno when waiting for a process status when a SIGCHLD is received

9 years agoFix typo
bapt [Wed, 16 Jul 2014 11:30:04 +0000 (11:30 +0000)]
Fix typo

9 years agoStyle(9) fix
bapt [Wed, 16 Jul 2014 11:28:53 +0000 (11:28 +0000)]
Style(9) fix

9 years agoFix build with gcc
bapt [Wed, 16 Jul 2014 10:37:05 +0000 (10:37 +0000)]
Fix build with gcc

9 years agoFix indentation
bapt [Wed, 16 Jul 2014 10:34:55 +0000 (10:34 +0000)]
Fix indentation

9 years agoNew BSDL timeout(1) utility compatible with GNU timeout
bapt [Wed, 16 Jul 2014 09:55:36 +0000 (09:55 +0000)]
New BSDL timeout(1) utility compatible with GNU timeout

it fully passes the GNU timeout regression tests, it is written in a mostly
portable way (only signal parsing is relying on non portable structures)

Phabric: D377

9 years agoImprove support for Intel Lynx Point USB 3.0 controllers by using the
hselasky [Wed, 16 Jul 2014 06:14:41 +0000 (06:14 +0000)]
Improve support for Intel Lynx Point USB 3.0 controllers by using the
USB 2.0 port mask in addition to the USB 3.0 port mask. The hardware
does not always accept when writing -1U to the port switching
registers.

MFC after: 3 days
Tested by: Huang Wen Hui <huanghwh@gmail.com>

9 years agoWhen we fail to extract the pkg binaries (for example, / is read-only),
gavin [Wed, 16 Jul 2014 00:12:57 +0000 (00:12 +0000)]
When we fail to extract the pkg binaries (for example, / is read-only),
give a more helpful error message.

MFC after: 1 week

9 years agoAdd a bandaid to fix GCC build (on sparc64 et al).
delphij [Tue, 15 Jul 2014 23:35:06 +0000 (23:35 +0000)]
Add a bandaid to fix GCC build (on sparc64 et al).

9 years agoMove the "retry:" label so that the calls to m_pullup() are
rmacklem [Tue, 15 Jul 2014 23:32:13 +0000 (23:32 +0000)]
Move the "retry:" label so that the calls to m_pullup() are
not done after the call to m_defrag(). This fixes a problem
where m_pullup() would prepend an mbuf to the list created
by m_defrag() making the chain greater than 32 again.

Tested by: rcarter@pinyon.org
Reviewed by: yongari, jfv
MFC after: 2 weeks

9 years agoSince r202933, kthread_suspend_check() takes no arguments. Update the
gavin [Tue, 15 Jul 2014 23:29:20 +0000 (23:29 +0000)]
Since r202933, kthread_suspend_check() takes no arguments.  Update the
example to match.

MFC after: 3 days

9 years agoAlso link 'show bio' to g_bio(9.)
bdrewery [Tue, 15 Jul 2014 22:57:50 +0000 (22:57 +0000)]
Also link 'show bio' to g_bio(9.)

X-MFC-With: r268715
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

9 years agoMFV r268714:
delphij [Tue, 15 Jul 2014 22:44:04 +0000 (22:44 +0000)]
MFV r268714:

Improve extreme rewind import.

When doing an "extreme rewind" import ("zpool import -XF"), we attempt
to verify all data in the pool, essentially scrubbing the entire pool.
The problem is that spa_load_verify_cb() issues an unbounded number of
concurrent scrub i/os.  This can lead to all of memory being used for
these zio's, wedging the system. Like normal scrub, we need to put a
cap on the number of outstanding i/os, and have the traverse thread
block when we reach this cap.

For this purpose the cap can be very large (10,000) to optimize the
elevator algorithm.  Three kernel tunables have been added:

vfs.zfs.spa_load_verify_maxinflight
vfs.zfs.spa_load_verify_metadata
vfs.zfs.spa_load_verify_data

The latter two tunables controls whether metadata and/or user data
when doing extreme rewind.

Make 'zpool import -T' imply scrub.

Make zpool import -T <txg> accept hexadecimal values for the txg when
prefixed with 0x.

Skip txg's for which there is no uberblock when doing extreme rewind.

Skip reading all user data twice by skipping prefetches when doing
extreme rewinds as we do not access via the ARC.

Illumos issues:
  4970 need controls on i/o issued by zpool import -XF
  4971 zpool import -T should accept hex values
  4972 zpool import -T implies extreme rewind, and thus a scrub
  4973 spa_load_retry retries the same txg
  4974 spa_load_verify() reads all data twice

MFC after: 2 weeks

9 years agoDocument the 'show bio' command added in 2009.
bdrewery [Tue, 15 Jul 2014 21:13:08 +0000 (21:13 +0000)]
Document the 'show bio' command added in 2009.

While here also reword 'show buffer' to have an 'addr' argument and to
match other struct documentation.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

9 years agoMFV r268702:
delphij [Tue, 15 Jul 2014 20:32:23 +0000 (20:32 +0000)]
MFV r268702:

Add missing *_destroy() calls in various places with ZFS.

Illumos issue:
  4975 missing mutex_destroy() calls in zfs

MFC after: 2 weeks

9 years agoFollowup to r268466.
kib [Tue, 15 Jul 2014 19:57:03 +0000 (19:57 +0000)]
Followup to r268466.

- Move the code to calculate resident count into separate function.
  It reduces the indent level and makes the operation of
  vmmap_skip_res_cnt tunable more clear.
- Optimize the calculation of the resident page count for map entry.
  Skip directly to the next lowest available index and page among the
  whole shadow chain.
- Restore the use of pmap_incore(9), only to verify that current
  mapping is indeed superpage.
- Note the issue with the invalid pages.

Suggested and reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoChange the calculation of the kinfo_vmentry field kve_private_resident
kib [Tue, 15 Jul 2014 19:49:00 +0000 (19:49 +0000)]
Change the calculation of the kinfo_vmentry field kve_private_resident
to reflect its name.

Noted and reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agocxgbe(4): Display CF facility correctly in the device log.
np [Tue, 15 Jul 2014 18:24:41 +0000 (18:24 +0000)]
cxgbe(4): Display CF facility correctly in the device log.

MFC after: 3 days

9 years agoAdd support for operand size and address size override prefixes in bhyve's
neel [Tue, 15 Jul 2014 17:37:17 +0000 (17:37 +0000)]
Add support for operand size and address size override prefixes in bhyve's
instruction emulation [1].

Fix bug in emulation of opcode 0x8A where the destination is a legacy high
byte register and the guest vcpu is in 32-bit mode. Prior to this change
instead of modifying %ah, %bh, %ch or %dh the emulation would end up
modifying %spl, %bpl, %sil or %dil instead.

Add support for moffsets by treating it as a 2, 4 or 8 byte immediate value
during instruction decoding.

Fix bug in verify_gla() where the linear address computed after decoding
the instruction was not being truncated to the effective address size [2].

Tested by: Leon Dang [1]
Reported by: Peter Grehan [2]
Sponsored by: Nahanni Systems

9 years agoActually set the "no execute" bit on 1 MB page mappings in pmap_protect().
alc [Tue, 15 Jul 2014 17:16:06 +0000 (17:16 +0000)]
Actually set the "no execute" bit on 1 MB page mappings in pmap_protect().
Previously, the "no execute" bit was being set directly in the PTE, instead
of the local variable in which the new PTE value is being constructed.  So,
when the local variable was finally assigned to the PTE, the "no execute"
bit setting was lost.

9 years agoFix build with SMP disabled.
jhb [Tue, 15 Jul 2014 15:40:33 +0000 (15:40 +0000)]
Fix build with SMP disabled.

CR: https://phabric.freebsd.org/D407
Reviewed by: royger

9 years agoAdd a comment to explain the EAGAIN is only there for POSIX compliance
bapt [Tue, 15 Jul 2014 15:29:43 +0000 (15:29 +0000)]
Add a comment to explain the EAGAIN is only there for POSIX compliance

Resquested by: kib
Reviewed by: des

9 years agoMake amd64 pmap_copy_pages() functional for pages not mapped by DMAP.
kib [Tue, 15 Jul 2014 09:30:43 +0000 (09:30 +0000)]
Make amd64 pmap_copy_pages() functional for pages not mapped by DMAP.

Requested and reviewed by: royger
Tested by: pho, royger
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoEliminate repeated calculation of next_bucket in pmap_protect() and
alc [Tue, 15 Jul 2014 05:34:27 +0000 (05:34 +0000)]
Eliminate repeated calculation of next_bucket in pmap_protect() and
pmap_remove().  Eliminate an unnecessary variable from pmap_remove() and
pmap_advise().

9 years agoAdd image_data() for checking whether a sequence of blocks has data.
marcel [Tue, 15 Jul 2014 04:39:23 +0000 (04:39 +0000)]
Add image_data() for checking whether a sequence of blocks has data.
Use this for VHD and VMDK to avoid allocating space in the image
for empty sectors.

Note that this negatively affects performance because mkimg uses a
temporary file for the intermediate storage. When mkimg has better
internal book keeping, performance can be significantly improved.

9 years agolibc/stdlib: Minor cleanups to code originating in NetBSD
pfg [Tue, 15 Jul 2014 03:28:37 +0000 (03:28 +0000)]
libc/stdlib: Minor cleanups to code originating in NetBSD

Mostly ANSIfication and typos.

Obtained from: NetBSD
MFC after: 5 days

9 years agoDocument that listen(2) can fail with EDESTADDRREQ.
kevlo [Tue, 15 Jul 2014 02:21:51 +0000 (02:21 +0000)]
Document that listen(2) can fail with EDESTADDRREQ.

9 years agolibc/gen: small updates to code originating at OpenBSD
pfg [Tue, 15 Jul 2014 02:21:35 +0000 (02:21 +0000)]
libc/gen: small updates to code originating at OpenBSD

arc4random.c
- CVS rev. 1.22
Change arc4random_uniform() to calculate ``2**32 % upper_bound'' as
``-upper_bound % upper_bound''. Simplifies the code and makes it the
same on both ILP32 and LP64 architectures, and also slightly faster on
LP64 architectures by using a 32-bit remainder instead of a 64-bit
remainder.
- CVS rev. 1.23
Spacing

readpassphrase.c
-CVS rev. v 1.24
most obvious unsigned char casts for ctype

Obtained from: OpenBSD
MFC after: 5 days

9 years agoFix an issue with service(8) where utilities such as screen(1) and tmux(1)
dteske [Tue, 15 Jul 2014 02:18:55 +0000 (02:18 +0000)]
Fix an issue with service(8) where utilities such as screen(1) and tmux(1)
would behave differently when utilizing rc-script was invoked manually vs.
service(8). The issue being that these utilities require the TERM environ
variable to be set and service(8) was not passing it down.

Reported by: Michael Dexter <editor@callfortesting.org>
PR: bin/191869
Reviewed by: allanjude
MFC after: 3 days
X-MFC-to: stable/10, stable/9

9 years agoAllow multi-byte reads in the private CHELSIO_T4_GET_I2C ioctl. The
np [Tue, 15 Jul 2014 01:03:29 +0000 (01:03 +0000)]
Allow multi-byte reads in the private CHELSIO_T4_GET_I2C ioctl.  The
firmware allows up to 48B to be read this way but the driver limits
itself to 8B at a time to remain compatible with old cxgbetool
binaries.

MFC after: 1 week

9 years agoUse the blockif CHS routine to create fake CHS values,
grehan [Tue, 15 Jul 2014 00:27:08 +0000 (00:27 +0000)]
Use the blockif CHS routine to create fake CHS values,
and then populate them in the identity page.

This fixes a divide-by-zero error at probe time with NetBSD.

MFC after: 1 week.

9 years agoAdd a call to synthesize a C/H/S value for block emulations
grehan [Tue, 15 Jul 2014 00:25:54 +0000 (00:25 +0000)]
Add a call to synthesize a C/H/S value for block emulations
that require it (ahci). The algorithm used is from the VHD
specification.

9 years agofortune(8): Search fortune files installed by ports/packages as well as
gavin [Mon, 14 Jul 2014 23:25:29 +0000 (23:25 +0000)]
fortune(8): Search fortune files installed by ports/packages as well as
those supplied by the base system.

PR: 191800
Submitted by: Andy Kosela
MFC after: 1 week

9 years agoPlug p_pptr null test in do_execve. It is always true.
mjg [Mon, 14 Jul 2014 22:40:46 +0000 (22:40 +0000)]
Plug p_pptr null test in do_execve. It is always true.

9 years agonewfs_msdosfs: Respect FSFIXFAT
pfg [Mon, 14 Jul 2014 21:32:40 +0000 (21:32 +0000)]
newfs_msdosfs: Respect FSFIXFAT

Fix some whitespace issues while here.

Obtained from: NetBSD (rev. 1.9)
MFC after: 3 days

9 years agoManage struct sigacts refcnt with atomics instead of a mutex.
mjg [Mon, 14 Jul 2014 21:12:59 +0000 (21:12 +0000)]
Manage struct sigacts refcnt with atomics instead of a mutex.

MFC after: 1 week

9 years agoFix the Zedboard/Zynq ethernet driver to handle media speed changes so
ian [Mon, 14 Jul 2014 20:58:57 +0000 (20:58 +0000)]
Fix the Zedboard/Zynq ethernet driver to handle media speed changes so
that it can connect to switches at speeds other than 1gb.

This requires changing the reference clock speed.  Since we still don't
have a general clock API that lets a SoC-independant driver manipulate its
own clocks, this change includes a weak reference to a routine named
cgem_set_ref_clk().  The default implementation is a no-op; SoC-specific
code can provide an implementation that actually changes the speed.

Submitted by: Thomas Skibo <ThomasSkibo@sbcglobal.net>

9 years agomsdosfs: Assorted fixes from other BSDs.
pfg [Mon, 14 Jul 2014 20:58:02 +0000 (20:58 +0000)]
msdosfs: Assorted fixes from other BSDs.

When truncating cluster chains fix the length of the cluster head.
http://marc.info/?t=140304310700005&r=1&w=2

Avoid infinite loops in cluster chain linked lists.
http://marc.info/?l=openbsd-tech&m=140275150804337&w=2

Avoid off-by-one on FAT12 filesystems.
http://marc.info/?l=openbsd-tech&m=140234174104724&w=2

Obtained from: NetBSD (from OpenBSD)
MFC after: 1 week

9 years agofsck_msdosfs: be a bit more permissive
pfg [Mon, 14 Jul 2014 20:17:09 +0000 (20:17 +0000)]
fsck_msdosfs: be a bit more permissive

The free space value in the FSInfo block is merely unitialized when it is
0xffffffff. This fixes a bug found in NetBSD.

It must be noted that we never supported all the checks that NetBSD does
as some of them would cause failures with a freshly created FAT32
from MS-Windows.

While here, bring some space fixes.

Obtained from: NetBSD (rev. 1.22)
MFC after: 3 days

9 years agoMinor (mostly cosmetic) cleanups
pfg [Mon, 14 Jul 2014 19:16:49 +0000 (19:16 +0000)]
Minor (mostly cosmetic) cleanups

Several whitespace fixes
convert *rootDir from external to static.

Obtained from: NetBSD, OpenBSD (partial)
MFC after: 3 days

9 years agoBump mdoc date after r268621.
delphij [Mon, 14 Jul 2014 17:54:36 +0000 (17:54 +0000)]
Bump mdoc date after r268621.

X-MFC-With: r268621

9 years agoOn my Lenovo laptop, the firmware maps the EFI framebuffer with MTRRs set
nwhitehorn [Mon, 14 Jul 2014 17:42:22 +0000 (17:42 +0000)]
On my Lenovo laptop, the firmware maps the EFI framebuffer with MTRRs set
to uncacheable. This leads to execrable console performance. Once PMAP is
up, remap the framebuffer as write-combining. This reduces boot time on my
laptop by 60% when booting with EFI.

MFC after: 2 weeks

9 years agoEliminate dead code. There is no direct map. This code was cut-and-pasted
alc [Mon, 14 Jul 2014 17:16:09 +0000 (17:16 +0000)]
Eliminate dead code.  There is no direct map.  This code was cut-and-pasted
from amd64.

9 years agoDon't report non-native block-size pools under zpool status -x
smh [Mon, 14 Jul 2014 14:33:03 +0000 (14:33 +0000)]
Don't report non-native block-size pools under zpool status -x

zpool status -x is used to identify pools that are exhibiting
errors or are otherwise unavailable, therefore non-native
block-size pools shouldn't be reported.

Also update man page to clarify other additional conditions
which won't cause a pool to be displayed under zpool status -x.

Sponsored by: Multiplay

9 years agoMake generation of nslexer.c more robust.
jmmv [Mon, 14 Jul 2014 13:53:10 +0000 (13:53 +0000)]
Make generation of nslexer.c more robust.

Ensure that lex errors fail the build instead of being silently ignored
due to the piped call.  Also postpone the update of the nslexer.c file
until we are sure we have generated it properly.

These changes fix some very obscure build failures I encountered while
building FreeBSD within a chroot that did not have devfs mounted. The
specific errors looked like:

.../libc.so.7: undefined reference to `_nsyyerror'
.../libc.so.7: undefined reference to `_nsyyin'
.../libc.so.7: undefined reference to `_nsyylex'
.../libc.so.7: undefined reference to `_nsyylineno'
.../libc.so.7: undefined reference to `_nsyytext'

and were caused due to a mangled nslexer.c being linked into libc.

9 years agoUnbreak the build by re-enabling exceptions.
gahr [Mon, 14 Jul 2014 12:24:38 +0000 (12:24 +0000)]
Unbreak the build by re-enabling exceptions.

Disabling them breaks build on archs using GCC. The problem is at line 156 of
bits/basic_ios.h:

if (this->exceptions() & __state)
__throw_exception_again;

With exceptions disabled __throw_exception_again is defined as

#define __throw_exception_again

at line 45 of exception_defines.h and the code results in an empty loop body,
which fails because of -Werror.

Approved by: cognet

9 years agoRework the tmpfs unmount.
kib [Mon, 14 Jul 2014 09:52:33 +0000 (09:52 +0000)]
Rework the tmpfs unmount.

- Suspend filesystem for unmount.  This prevents new tmpfs nodes from
  instantiating, and also ensures that only unmount thread can destroy
  nodes.

- Do not start tmpfs node deletion until all vnodes are reclaimed,
  which guarantees that no thread can access tmpfs data.  For this,
  call vflush() in the loop, until the mnt_nvnodelistsize is non-zero.
  Note that after mnt_nvnodelistsize becomes 0, insmntque() blocks
  insertion of a vnode germ into the mount list of vnodes.

- Fail node allocation when the filesystem is being unmounted.  This
  is race-free due to the vflush() call in loop.  This is mostly
  cosmetic, avoiding some more work which might be done until
  suspension in unmount is started.

Note that there is currently no way to prevent new vnode instantiation
from readers during the unmount.  Due to this, forced unmount might
live-lock if vflush() loop cannot get to the zero vnode count due to
races with readers.  The unmount would proceed after the load is
lifted.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoChange forgotten in r268615. Set the OBJ_TMPFS_NODE flag for
kib [Mon, 14 Jul 2014 09:35:14 +0000 (09:35 +0000)]
Change forgotten in r268615.  Set the OBJ_TMPFS_NODE flag for
vm_object of VREG tmpfs node.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoThe OBJ_TMPFS flag of vm_object means that there is unreclaimed tmpfs
kib [Mon, 14 Jul 2014 09:30:37 +0000 (09:30 +0000)]
The OBJ_TMPFS flag of vm_object means that there is unreclaimed tmpfs
vnode for the tmpfs node owning this object.  The flag is currently
used for two purposes.  First, it allows to correctly handle VV_TEXT
for tmpfs vnode when the ref count on the object is decremented to 1,
similar to vnode_pager_dealloc() for regular filesystems.  Second, it
prevents some operations, which are done on OBJT_SWAP vm objects
backing user anonymous memory, but are incorrect for the object owned
by tmpfs node.

The second kind of use of the OBJ_TMPFS flag is incorrect, since the
vnode might be reclaimed, which clears the flag, but vm object
operations must still be disallowed.

Introduce one more flag, OBJ_TMPFS_NODE, which is permanently set on
the object for VREG tmpfs node, and used instead of OBJ_TMPFS to test
whether vm object collapse and similar actions should be disabled.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoUse tmpfs_vn_get_ino_gen() to handle the races with reclaim in tmpfs
kib [Mon, 14 Jul 2014 09:16:55 +0000 (09:16 +0000)]
Use tmpfs_vn_get_ino_gen() to handle the races with reclaim in tmpfs
dotdot lookup.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoStyle. Add comment about lock mode.
kib [Mon, 14 Jul 2014 09:13:56 +0000 (09:13 +0000)]
Style.  Add comment about lock mode.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoExtract the code to put a filesystem into the suspended state (at the
kib [Mon, 14 Jul 2014 09:10:00 +0000 (09:10 +0000)]
Extract the code to put a filesystem into the suspended state (at the
unmount time) in the helper vfs_write_suspend_umnt().  Use it instead
of two inline copies in FFS.

Fix the bug in the FFS unmount, when suspension failed, the ufs
extattrs were not reinitialized.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoIn tmpfs_alloc_file(), code after the 'out' label does only 'return
kib [Mon, 14 Jul 2014 09:02:40 +0000 (09:02 +0000)]
In tmpfs_alloc_file(), code after the 'out' label does only 'return
error;'.  Replace goto's with the return.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoAdd convenience macro to assert tmpfs node lock.
kib [Mon, 14 Jul 2014 08:59:25 +0000 (08:59 +0000)]
Add convenience macro to assert tmpfs node lock.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoAdd some assertions for the code handling vm_object for tmpfs vnode.
kib [Mon, 14 Jul 2014 08:55:02 +0000 (08:55 +0000)]
Add some assertions for the code handling vm_object for tmpfs vnode.
In particular, vnode must be exclusively locked when the tmpfs vnode
and object are divorced.  When the vnode is opened, the object must be
still alive, since only live vnode can be opened, and the tmpfs node
owns a reference on the object.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoThe tmpfs_link() must not dereference the filesystem-specific data for
kib [Mon, 14 Jul 2014 08:45:29 +0000 (08:45 +0000)]
The tmpfs_link() must not dereference the filesystem-specific data for
a vnode until it is verified that the vnode indeed belongs to tmpfs
mount.  Otherwise, it might access random memory, at least in the
debug kernel.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoIn kern_linkat(), avoid passing doomed vnode to the VOP.
kib [Mon, 14 Jul 2014 08:41:13 +0000 (08:41 +0000)]
In kern_linkat(), avoid passing doomed vnode to the VOP.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoGeneralize vn_get_ino() to allow filesystems to use custom vnode
kib [Mon, 14 Jul 2014 08:34:54 +0000 (08:34 +0000)]
Generalize vn_get_ino() to allow filesystems to use custom vnode
producer, instead of hard-coding VFS_VGET().  New function, which
takes callback, is called vn_get_ino_gen(), standard callback for
vn_get_ino() is provided.

Convert inline copies of vn_get_ino() in msdosfs and cd9660 into the
uses of vn_get_ino_gen().

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoRemove code separator lines which do not conform to style(9).
kib [Mon, 14 Jul 2014 08:17:11 +0000 (08:17 +0000)]
Remove code separator lines which do not conform to style(9).

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoMake bind(2) and connect(2) return EAFNOSUPPORT for AF_UNIX on wrong
kevlo [Mon, 14 Jul 2014 06:00:01 +0000 (06:00 +0000)]
Make bind(2) and connect(2) return EAFNOSUPPORT for AF_UNIX on wrong
address family.

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191586 for the
original discussion.

Reviewed by: terry

9 years agoInvoke the DTrace trap handler before calling trap() on amd64. This matches
markj [Mon, 14 Jul 2014 04:38:17 +0000 (04:38 +0000)]
Invoke the DTrace trap handler before calling trap() on amd64. This matches
the upstream implementation and helps ensure that a trap induced by tracing
fbt::trap:entry is handled without recursively generating another trap.

This makes it possible to run most (but not all) of the DTrace tests under
common/safety/ without triggering a kernel panic.

Submitted by: Anton Rang <anton.rang@isilon.com> (original version)
Phabric: D95

9 years agoExplicitly disable the build of tests when building bmake.
jmmv [Sun, 13 Jul 2014 23:53:41 +0000 (23:53 +0000)]
Explicitly disable the build of tests when building bmake.

During "make buildworld", building bmake is (one of) the very first steps
and we should not be building any of its tests.  Conceptually, this is the
right thing to do 1) for build simplicity reasons and 2) because there is
no need to build any tests this early on.

In practice, this fixes tinderbox builds of CURRENT from 9.x when MK_TESTS
is enabled.  This is because bsd.test.mk needs some modern bmake features
not present in 9.x (:tW) and tinderbox is forcing the build to use the
CURRENT share/mk files from the very beginning (see r266617).  By skipping
the build of the tests when still using the host make, we omit the problem.
Arguably, what tinderbox is doing is wrong and needs to be addressed, but
that is a separate issue.

9 years ago* Update the comments to agree with commit r226595.
kargl [Sun, 13 Jul 2014 23:10:39 +0000 (23:10 +0000)]
* Update the comments to agree with commit r226595.

* While here, fix a nearby typo in a comment.

9 years agoEliminate an unused variable. Refresh two comments.
alc [Sun, 13 Jul 2014 17:52:07 +0000 (17:52 +0000)]
Eliminate an unused variable.  Refresh two comments.

9 years ago* Makefile:
kargl [Sun, 13 Jul 2014 17:05:03 +0000 (17:05 +0000)]
* Makefile:
  . Add s_erfl.c to building libm.
  . Add MLINKS for erfl.3 and erfcl.3.

* Symbol.map:
  . Move erfl and erfcl to their proper location.

* ld128/s_erfl.c:
  . Implementations of erfl and erfcl in the IEEE 754 128-bit format.

* ld80/s_erfl.c:
  . Implementations of erfl and erfcl in the Intel 80-bit format.

* man/erf.3:
  . Document the new functions.
  . While here, remove an incomplete sentence.

* src/imprecise.c:
  . Remove the stupidity of mapping erfl and erfcl to erf and erfc.

* src/math.h:
  . Move the declarations of erfl and erfcl to their proper place.

* src/s_erf.c:
  . For architectures where double and long double are the same
    floating point format, use weak references to map erfl to
    erf and ercl to erfc.

Reviewed by: bde (many earlier versions)

9 years agoImplement pmap_unwire(). See r268327 for the motivation behind this change.
alc [Sun, 13 Jul 2014 16:27:57 +0000 (16:27 +0000)]
Implement pmap_unwire().  See r268327 for the motivation behind this change.

9 years ago* Use 9 digits instead of 11 digits in efx and efx8.
kargl [Sun, 13 Jul 2014 16:24:16 +0000 (16:24 +0000)]
* Use 9 digits instead of 11 digits in efx and efx8.

* Update the domain and range of comments for the polynomial
  approximations, including using the the correct variable names
  (e.g., pp(x) instead of p(x)).

* Use hex values of the form 0x3e0375d4 instead of 0x1.06eba8p-3,
  which was obtained from printf("%.6a").

* In the domain [0.84375, 1.25], qa(x) can be reduced from a 4th
  order polynomial to 3rd order.

* In the domain [1.25,1/0.35], sa(x) can be reduced from a 4th
  order polynomial to 3rd order.

* In the domain [1/0.35, 11], the 4th order polynomials rb(x) and
  sb(x) can be reduced to 2nd and 3rd order, respectively.

9 years ago* Update the comments that refer to erf[c](nan) and erf[c](+-inf)
kargl [Sun, 13 Jul 2014 16:05:33 +0000 (16:05 +0000)]
* Update the comments that refer to erf[c](nan) and erf[c](+-inf)
  to use erf[c]f.

9 years ago* Use the volatile qualifier for 'tiny' to prevent compilers
kargl [Sun, 13 Jul 2014 15:45:45 +0000 (15:45 +0000)]
* Use the volatile qualifier for 'tiny' to prevent compilers
  from erronously constant folding expressions of the form
  '1 - tiny'.  This allows erf[f](x) to raise INEXACT.

* Use 0.5, 1, and 2, which are exactly representable in radix-2
  floating point formats.  This reduces diffs between s_erf[fl].c.

* While here, add a comment about efx and efx8.

9 years agoWhitespace.
kargl [Sun, 13 Jul 2014 15:15:51 +0000 (15:15 +0000)]
Whitespace.

9 years agoUnbreak with gcc.
pluknet [Sun, 13 Jul 2014 10:38:01 +0000 (10:38 +0000)]
Unbreak with gcc.

I'm tired to see tinderbox spamming.  Feel free to fix it your way.

9 years agoAdd a headphone redirection quirk for the Lenovo G580.
markj [Sun, 13 Jul 2014 10:31:29 +0000 (10:31 +0000)]
Add a headphone redirection quirk for the Lenovo G580.

MFC after: 1 week

9 years agoTurn off blinking device leds at attach.
hselasky [Sun, 13 Jul 2014 09:34:59 +0000 (09:34 +0000)]
Turn off blinking device leds at attach.

MFC after: 3 days
PR: 183735

9 years agoFix performance problems with AXGE network adapter in RX direction:
hselasky [Sun, 13 Jul 2014 07:39:28 +0000 (07:39 +0000)]
Fix performance problems with AXGE network adapter in RX direction:
- Remove 4 extra bytes from the ethernet payload.
- The maximum RX buffer was incorrectly set. Increase it to 64K for
now, until the exact limit is understood.
- Enable hardware checksumming again.
- Make hardware data structure packed.

MFC after: 3 days

9 years agoMerge several equal serialization indexes.
mav [Sun, 13 Jul 2014 06:01:23 +0000 (06:01 +0000)]
Merge several equal serialization indexes.

9 years agosh: Correctly handle positional parameters beyond INT_MAX on 64-bit systems.
jilles [Sat, 12 Jul 2014 21:54:11 +0000 (21:54 +0000)]
sh: Correctly handle positional parameters beyond INT_MAX on 64-bit systems.

Currently, there can be no more than INT_MAX positional parameters. Make
sure to treat all higher ones as unset to avoid incorrect results and
crashes.

On 64-bit systems, our atoi() takes the low 32 bits of the strtol() and
sign-extends them.

On 32-bit systems, the call to atoi() returned INT_MAX for too high values
and there is not enough address space for so many positional parameters, so
there was no issue.

9 years agoAdd bsd.dtrace.mk to obsolete files.
rpaulo [Sat, 12 Jul 2014 21:24:28 +0000 (21:24 +0000)]
Add bsd.dtrace.mk to obsolete files.

MFC after: 3 weeks.

9 years agoClear nonblock and async on devctl close instaed of open.
mjg [Sat, 12 Jul 2014 15:35:04 +0000 (15:35 +0000)]
Clear nonblock and async on devctl close instaed of open.

This is a purely cosmetic change.