freebsd.git
9 years agoUpdate libucl to the 2014-07-16 snapshot
bapt [Fri, 18 Jul 2014 06:58:01 +0000 (06:58 +0000)]
Update libucl to the 2014-07-16 snapshot
This update brings streamlined ucl emitter support

9 years agoRemove an obsolete man page.
alc [Fri, 18 Jul 2014 06:56:24 +0000 (06:56 +0000)]
Remove an obsolete man page.

9 years agoImport libucl 2014-07-16
bapt [Fri, 18 Jul 2014 06:49:18 +0000 (06:49 +0000)]
Import libucl 2014-07-16

9 years agoFix "ndp -d hostname".
peter [Fri, 18 Jul 2014 06:48:02 +0000 (06:48 +0000)]
Fix "ndp -d hostname".

9 years agoMinor sorting to match the NetBSD header
pfg [Fri, 18 Jul 2014 02:49:41 +0000 (02:49 +0000)]
Minor sorting to match the NetBSD header

MFC after: 3 days
Obtained from: NetBSD

9 years agoRemove deprecated definition "m_act".
kevlo [Fri, 18 Jul 2014 01:35:20 +0000 (01:35 +0000)]
Remove deprecated definition "m_act".

Suggested by: adrian, glebius

9 years agoFix manpages path and sort entries
bapt [Thu, 17 Jul 2014 23:30:29 +0000 (23:30 +0000)]
Fix manpages path and sort entries

9 years agoRemove texinfo manpages as well if built WITHOUT_INFO
bapt [Thu, 17 Jul 2014 23:24:33 +0000 (23:24 +0000)]
Remove texinfo manpages as well if built WITHOUT_INFO

9 years agoFix markups.
delphij [Thu, 17 Jul 2014 23:23:01 +0000 (23:23 +0000)]
Fix markups.

9 years agoFix markup regression introduced in r268369.
delphij [Thu, 17 Jul 2014 23:14:47 +0000 (23:14 +0000)]
Fix markup regression introduced in r268369.

9 years agoAdd the mtree entry for yacc tests
bapt [Thu, 17 Jul 2014 22:26:24 +0000 (22:26 +0000)]
Add the mtree entry for yacc tests

9 years agoUpdate to byacc 20140715 (only concerns regression tests being fixed)
bapt [Thu, 17 Jul 2014 22:22:38 +0000 (22:22 +0000)]
Update to byacc 20140715 (only concerns regression tests being fixed)
Directly use regression test from upstream

PR: 191020
Submitted by: gcooper (yaneurabeya@gmail.com)

9 years agoIncrease maximal number of SCSI ports in CTL from 32 to 128.
mav [Thu, 17 Jul 2014 21:16:52 +0000 (21:16 +0000)]
Increase maximal number of SCSI ports in CTL from 32 to 128.

After I gave each iSCSI target its own port, the old limit appeared to be
not so big.  This change almost proportionally increases per-LUN memory
use, but it is still three times better then it was before r268807.

MFC after: 2 weeks

9 years agoReduce per-LUN memory usage from 18MB to 1.8MB.
mav [Thu, 17 Jul 2014 20:28:51 +0000 (20:28 +0000)]
Reduce per-LUN memory usage from 18MB to 1.8MB.

CTL never had use for CA support code since SPI has gone, and there is no
even frontends supporting that.  But it still was reserving 256 bytes of
memory per LUN per every possible initiator on every possible port.

Wrap unused code with ifdef's in case somebody even need it.

MFC after: 2 weeks

9 years agoAdd a man page for the new function pmap_unwire().
alc [Thu, 17 Jul 2014 20:03:52 +0000 (20:03 +0000)]
Add a man page for the new function pmap_unwire().

9 years agoReplace all uses of libncurses and libtermcap with their wide character
brooks [Thu, 17 Jul 2014 18:24:34 +0000 (18:24 +0000)]
Replace all uses of libncurses and libtermcap with their wide character
variants.  This allows usable file system images (i.e. those with both a
shell and an editor) to be created with only one copy of the curses library.

Exp-run: antoine
PR: 189842
Discussed with: bapt
Sponsored by: DARPA, AFRL

9 years agoRemove the man page for a pmap function that no longer exists.
alc [Thu, 17 Jul 2014 17:41:32 +0000 (17:41 +0000)]
Remove the man page for a pmap function that no longer exists.

9 years agoAdd support for the fixed image type. The fixed image is effectively
marcel [Thu, 17 Jul 2014 16:33:38 +0000 (16:33 +0000)]
Add support for the fixed image type. The fixed image is effectively
a raw image with a VHD footer appended. There's little value that I
can see to use the fixed image type, but in order to make VHD images
for use by Microsoft's Azure platform, they must be fixed VHD images.

Support has been added by refactoring the code to re-use common code
and by adding a second output format structure.  To created fixed VHD
images, specify "vhdf" as the output format.

9 years agogrep: fix some memory leaks.
pfg [Thu, 17 Jul 2014 15:59:13 +0000 (15:59 +0000)]
grep: fix some memory leaks.
Add memory leak fix missing from r268799.

Obtained from: NetBSD

9 years agoFix indentation
bdrewery [Thu, 17 Jul 2014 15:50:23 +0000 (15:50 +0000)]
Fix indentation

9 years agogrep: fix some memory leaks.
pfg [Thu, 17 Jul 2014 15:48:11 +0000 (15:48 +0000)]
grep: fix some memory leaks.

Bring a couple of changes from NetBSD:

queue.c (CVS Rev. 1.4. 1.5)
Fix memory leaks.
NULL does not need a cast.

grep.c (CVS Rev. 1.6)
Use the more portable getline.

Obtained from: NetBSD
MFC after: 3 days

9 years agogrep: Fix type.
pfg [Thu, 17 Jul 2014 14:51:50 +0000 (14:51 +0000)]
grep: Fix type.

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

9 years agoFix embarassing typos I made.
nwhitehorn [Thu, 17 Jul 2014 12:47:34 +0000 (12:47 +0000)]
Fix embarassing typos I made.

Submitted by: rayddteam

9 years agoFix ctld crash on startup if target alias is not set.
mav [Thu, 17 Jul 2014 11:38:37 +0000 (11:38 +0000)]
Fix ctld crash on startup if target alias is not set.

MFC after: 3 days

9 years agounits(1): Add basic tests
eadler [Thu, 17 Jul 2014 07:12:12 +0000 (07:12 +0000)]
units(1): Add basic tests
Add some tests to help avoid breaking units

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