197235 Commits

Author SHA1 Message Date
jhb
8376a78d70 MFC 272668:
Properly set the timeout in a query_state.  The global query_timeout
configuration value is an integer count of seconds, it is not a timeval.
Using memcpy() to copy a timeval from it put garbage into the tv_usec
field.

PR:		194025
2014-10-17 19:55:12 +00:00
jhb
c8f54eb474 MFC 272449:
Require p_cansched() for changing a process' protection status via
procctl() rather than p_cansee().
2014-10-17 19:28:21 +00:00
emaste
9ea4006705 MFC r257302 by rea:
binutils/bfd: fix printf-like format strings for "bfd *" arguments

  There is a special format argument '%B' that directly handles values
  of type 'bfd *', they must be used instead of '%s'.  Manifestations
  of this bug can be seen in ld(1) error messages, for example,
    http://lists.freebsd.org/pipermail/freebsd-current/2013-August/043580.html
    http://lists.freebsd.org/pipermail/freebsd-current/2013-October/045404.html
2014-10-17 16:23:36 +00:00
jhb
b183e8b3c4 MFC 272182:
Don't panic if a resource is allocated twice.  Instead, print a warning and
fail the allocation request.  Allocations of "reserved" resources such as
PCI BARs already fail the request instead of panic'ing in this case.
2014-10-17 15:29:47 +00:00
gjb
14d211224f MFC r273093, r273096:
r273093:
  Merge the following from ^/projects/release-vmimage:
  r272436, r272437, r272792:

  r272436:
    Remove the first argument to panic(), which was initially
    intended to be the exit code, however when a non-zero exit
    code was returned to release/Makefile, this would prevent
    any remaining (and possibly successful) stages from being
    attempted.

  r272437:

    If the vm-base target fails, prevent the vm-image target
    from being run since it cannot possibly succeed.

  r272792:

    Add /usr/local/bin and /usr/local/sbin to PATH, needed
    if third-party software needs to use utilities outside
    of the base system during post-install stages (indexinfo
    is one culprit).

r273096:
  Merge the following from ^/projects/release-vmimage:
  r273076, r273077, r273079, r273095:

  r273076:
    Add a separate make(1) target to release/Makefile to
    build FreeBSD virtual machine disk images for use on
    the Microsoft Azure service.

    For now, this target is not directly connected to the
    build, however can be manually invoked.

    The 'vm-azure' target invokes {amd64,i386}/mk-azure.sh,
    which does the heavy lifting to produce proper VHDs.
    mk-azure.sh uses a configuration file, defaulting to
    tools/azure.conf if otherwise unset.

  r273077:
    Clear VM_RC_LIST.

  r273079:
    Fix signal list to trigger umount(8).

  r273095:
    Output an informational message when mkimg(1) runs, so it
    does not appear that the process has stopped while waiting
    for a 'y/n' response when waagent is deprovisioned.

Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
2014-10-16 23:16:26 +00:00
delphij
4b803d9674 MFC r272583: MFV r272500:
Don't inherit flags other than DS_FLAG_CI_DATASET and DS_FLAG_INCONSISTENT
when cloning.  This prevents DS_FLAG_DEFER_DESTROY being inherited from a
clone that is marked for deferred destroy, which causes snapshots of the
clone being destroyed when getting a hold or clone.

Illumos issue:
    5150 zfs clone of a defer_destroy snapshot causes strangeness
2014-10-16 22:44:30 +00:00
delphij
0615551739 MFC r272527:
Don't make nested definition for range_seg_cache.

Reported by:	ian
2014-10-16 22:40:22 +00:00
delphij
6fe321f152 MFC r272506: MFV r272495:
In arc_kmem_reap_now(), reap range_seg_cache too to reclaim memory in
response of memory pressure.

Illumos issue:
    5163 arc should reap range_seg_cache
2014-10-16 22:33:09 +00:00
delphij
9f9b89ac40 MFV r273060:
Use write_psize instead of write_asize when doing vdev_space_update.
Without this change the accounting of L2ARC usage would be wrong and
give 16EB free space because the number became negative and overflows.

Obtained from:  FreeNAS (issue #6239)
2014-10-16 22:12:23 +00:00
glebius
9ea3e68626 Merge r272385 by melifaro from head:
Free radix mask entries on main radix destroy.
  This is temporary commit to be merged to 10.
  Other approach (like hash table) should be used
  to store different masks.

PR:             194078
2014-10-16 20:46:02 +00:00
glebius
86f98e492e Merge r272358 from head:
Use rn_detachhead() instead of direct free(9) for radix tables.
2014-10-16 20:43:12 +00:00
smh
d66b9a9949 MFC r273158:
Prevent ZFS leaking pool free space

Early MFC approved by re@

Approved by:	re@ (glebius)
Sponsored by:	Multiplay
2014-10-16 08:33:11 +00:00
jkim
d37b3c75ad MFC: r272718
Make kern.nswbuf tunable from loader.
2014-10-15 20:04:21 +00:00
jkim
0b5b22505e MFC: r273144, r273146
Merge OpenSSL 1.0.1j.

Relnotes:	yes
2014-10-15 19:59:43 +00:00
jhb
44cc4e9f20 MFC 271721:
Explicitly specify MAP_SHARED when mapping the stats file descriptor.
2014-10-15 19:27:14 +00:00
kib
92c5a45b89 MFC r272761:
Add an argument to the x86 pmap_invalidate_cache_range() to request
forced invalidation of the cache range regardless of the presence of
self-snoop feature.

MFC r272943:
MFi386 r272761.
2014-10-15 14:07:24 +00:00
kib
c4d948e445 MFC r272070:
Expand the libthr(3) manpage to document knobs accepted by libthr.so
and explain some internal working of the library, neccessary to
understand the knobs effects.

MFC r272153 (by pluknet):
Fix description of mutex acquisition.
2014-10-15 13:39:00 +00:00
kib
6dfd0e1c93 MFC r272069:
Switch the defaults to not split the RLIMIT_STACK-sized initial thread
stack into the stacks of the created threads.  Add knob
LIBPTHREAD_SPLITSTACK_MAIN to restore the older behaviour.
2014-10-15 13:36:01 +00:00
mav
3c28f63ca3 MFC r272756: Properly report 12Gbps connection rate.
Reviewed by:	kadesai, slm
2014-10-15 08:03:12 +00:00
ae
1dfece27ff MFC r272749:
Fix comment.
2014-10-15 04:34:07 +00:00
pfg
ca6df600d4 MFC r267851:
Continue the crusade towards a dev_clone()-free kernel, removing its
usage from dtrace. The dtrace code already uses cdevpriv(9) since FreeBSD
8, so this change is quite harmless.

Originally by:	davide
Reviewed by:	markj
2014-10-14 23:16:52 +00:00
mjg
6eb4db1c33 MFC r269023,r272503,r272505,r272523,r272567,r272569,r272574
Prepare fget_unlocked for reading fd table only once.

Some capsicum functions accept fdp + fd and lookup fde based on that.
Add variants which accept fde.

===============================

Add sequence counters with memory barriers.

Current implementation is somewhat simplistic and hackish,
will be improved later after possible memory barrier overhaul.

===============================

Plug capability races.

fp and appropriate capability lookups were not atomic, which could result in
improper capabilities being checked.

This could result either in protection bypass or in a spurious ENOTCAPABLE.

Make fp + capability check atomic with the help of sequence counters.

===============================

Put and #ifdef _KERNEL around the #include for opt_capsicum.h to
hopefully allow the build to finish after r272505.

===============================

filedesc: fix up breakage introduced in 272505

Include sequence counter supports incoditionally [1]. This fixes reprted build
problems with e.g. nvidia driver due to missing opt_capsicum.h.

Replace fishy looking sizeof with offsetof. Make fde_seq the last member in
order to simplify calculations.

===============================

Keep struct filedescent comments within 80-char limit.

===============================

seq_t needs to be visible to userspace
2014-10-14 21:19:23 +00:00
skreuzer
d384077778 MFC r269627:
Mention tmpfs(5)

PR:             192389
Submitted by:   yaneurabeya@gmail.com
Approved by:    hrs (mentor)
2014-10-14 19:21:04 +00:00
gjb
bf64761c21 Revert r273084:
In the stable/ branches, release.prev intentionally points to the
  previous version, in addition to a number of intentional version
  mappings for the errata.html page, that this commit breaks.

Reported by:	hrs
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-10-14 16:44:15 +00:00
gjb
d8c07bdc2c Clean up the stable/10 errata document now that releng/10.1
has precedence over releng/10.0.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-10-14 13:06:13 +00:00
gjb
209cc41052 Update the FreeBSD versions in the stable/10 errata documentation
to reflect reality.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-10-14 13:03:11 +00:00
gjb
dcfed64a2e MFC r272414:
Merge the following revisions from ^/projects/release-vmimage:

  r272234, r272236, r272262, r272264, r272269, r272271, r272272,
  r272277, r272279, r272376, r272380, r272381, r272392, r272234,
  r272412:

  r272234:
    Initial commit to include virtual machine images as part
    of the FreeBSD release builds.

    This adds a make(1) environment variable requirement,
    WITH_VMIMAGES, which triggers the virtual machine image
    targets when not defined to an empty value.

    Relevant user-driven variables include:

     o VMFORMATS:	The virtual machine image formats to create.
       Valid formats are provided by running 'mkimg --formats'

     o VMSIZE:	The size of the resulting virtual machine
       image.  Typical compression is roughly 140Mb, regardless
       of the target size (10GB, 15GB, 20GB, 40GB sizes have been
       tested with the same result).

     o VMBASE:	The prefix of the virtual machine disk images.
       The VMBASE make(1) environment variable is suffixed with
       each format in VMFORMATS for each individual disk image, as
       well as '.img' for the source UFS filesystem passed to
       mkimg(1).

    This also includes a new script, mk-vmimage.sh, based on how
    the VM images for 10.0-RELEASE, 9.3-RELEASE, and 10.1-RELEASE
    were created (mk-vmimage.sh in ^/user/gjb/thermite/).

    With the order in which the stages need to occur, as well as
    sanity-checking error cases, it makes much more sense to
    execute a shell script called from make(1), using env(1) to
    set specific parameters for the target image than it does to
    do this in make(1) directly.

  r272236:
    Use VMBASE in place of a hard-coded filename in the CLEANFILES
    list.

  r272262:
    Remove a 'set -x' that snuck in during testing.

  r272264:
    release/Makefile:
      Connect the virtual machine image build to the release
      target if WITH_VMIMAGES is set to a non-empty value.

    release/release.sh:
      Add WITH_VMIMAGES to RELEASE_RMAKEFLAGS.

    release/release.conf.sample:
      Add commented entries for tuning the release build if the
      WITH_VMIMAGES make(1) environment variable is set to
      a non-empty value.

  r272269:
    release/Makefile:
      Include .OBJDIR in DESTDIR in the vm-base target.

    release/release.sh:
      Provide the full path to mddev.

  r272271:
    Fix UFS label for the root filesystem.

  r272272:
    Remove comments left in accidentally while testing, so the
    VM /etc/fstab is actually created.

  r272277:
    Remove the UFS label from the root filesystem since it is added
    by mkimg(1) as a gpt label, consistent with the fstab(5) entry.

  r272279:
    Comment cleanup in panic() message when mkimg(1) does not support
    the requested disk image format.

  r272376:
    Separate release/scripts/mk-vmimage.sh to machine-specific
    scripts, making it possible to mimic the functionality for
    non-x86 targets.

    Move echo output if MAKEFLAGS is empty outside of usage().

    Remove TARGET/TARGET_ARCH evaluation.

  r272380:
    Avoid using env(1) to set values passed to mk-vmimage.sh,
    and instead pass the values as arguments to the script,
    making it easier to run this by hand, without 'make release'.

    Add usage_vm_base() and usage_vm_image() usage helpers.

  r272381:
    After evaluating WITH_VMIMAGES is non-empty, ensure
    the mk-vmimage.sh script exists before running it.

  r272392:
    Add WITH_COMPRESSED_VMIMAGES variable, which when set enables
    xz(1) compression of the virtual machine images.

    This is intentionally separate to allow more fine-grained
    tuning over which images are compressed, especially in cases
    where compressing 20GB sparse images can take hours.

  r272412:
    Document the new 'vm-image' target, and associated release.conf
    variables.

  r272413:
    Remove two stray comments added during the initial iterations
    of testing, no longer needed.

Sponsored by:	The FreeBSD Foundation
2014-10-14 12:23:44 +00:00
mav
2cb46b9c51 MFC r271588: Update CAM CCB accounting for the new status quo.
devq_openings counter lost its meaning after allocation queues has gone.
held counter is still meaningful, but problematic to update due to separate
locking of CCB allocation and queuing.

To fix that replace devq_openings counter with allocated counter.  held is
now calculated on request as difference between number of allocated, queued
and active CCBs.
2014-10-14 12:13:01 +00:00
trasz
625b27b4d0 MFC r272932:
Mark iscontrol(8) and iscsi_initiator(4) obsolete.

Differential Revision:	https://reviews.freebsd.org/D931
Reviewed by:	wblock@
Sponsored by:	The FreeBSD Foundation
2014-10-14 07:52:37 +00:00
delphij
56f7d0497e MFC r272502: MFV r272493:
Show individual disk capacity when doing zpool list -v.

Illumos issue:
    5147 zpool list -v should show individual disk capacity
2014-10-13 18:53:56 +00:00
delphij
02d8987f8d Fix a missed merge introduced in r272883. 2014-10-13 18:46:30 +00:00
kib
9a0f569181 MFC r272907:
Make MAP_NOSYNC handling in the vm_fault() read-locked object path
compatible with write-locked path.
2014-10-13 15:58:03 +00:00
des
046882fc4f MFH (r272830): change the hardcoded default back to DES
MFH (r272833): remove last vestige of MD5 password hashes
2014-10-13 15:56:47 +00:00
des
3ebe22f969 MFH (r272173): offer to enable local_unbound after installation 2014-10-13 15:53:01 +00:00
dumbbell
b366d41790 vt(4): Don't recalculate buffer size if we don't know screen size
(MFC of r272537)

When the screen size is unknown, it's set to 0x0. We can't use that as
the buffer size, otherwise, functions such as vtbuf_fill() will fail.

This fixes a panic on RaspberryPi, where there's no vt(4) backend
configured early in boot.

PR:		193981
Tested by:	danilo@
2014-10-13 14:40:00 +00:00
dumbbell
6981999a42 vt(4): Save/restore keyboard mode & LED states when switching window
(MFC of r272416)

Add new functions to manipulate these mode & state, instead of calling
kbdd_ioctl() everyhere.

This fixes at least two bugs:

    1. The state of the Scroll Lock LED and the state of scroll mode
       could be out-of-sync. For instance, if one enables scroll mode on
       window #1 and switches to window #2, the LED would remain on, but
       the window wouldn't be in scroll mode.

       Similarily, when switching between a console and an X.Org
       session, the LED states could be inconsistent with the real
       state.

    2. When exiting from an X.Org session, the user could be unable to
       type anything. The workaround was to switch to another console
       window and come back.

Differential Revision:	https://reviews.freebsd.org/D821
Reviewed by:	ray@
Approved by:	ray@
Tested by:	kwm@
2014-10-13 13:50:51 +00:00
tuexen
ed67dea7a4 MFC r272841:
Ensure that the flags field of sctp_tmit_chunks is initialized.
Thanks to Peter Bostroem from Google for reporting the issue.
2014-10-12 17:45:22 +00:00
tuexen
b0912548c1 MFC r272751:
Ensure that the list of streams sent in a stream reset parameter fits
in an mbuf-cluster.
Thanks to Peter Bostroem for drawing my attention to this part of the code.
2014-10-12 17:42:32 +00:00
tuexen
85569fa02c MFC r272750:
Ensure that the number of stream reported in srs_number_streams is
consistent with the amount of data provided in the SCTP_RESET_STREAMS
socket option.
Thanks to Peter Bostroem from Google for drawing my attention to
this part of the code.
2014-10-12 17:39:37 +00:00
tuexen
4f377875d1 MFC r272571:
Remove unused MC_ALIGN macro as suggested by Robert.
2014-10-12 17:36:41 +00:00
cy
b41a810b86 MFC r272555
ipfilter bug #537 NAT rules with sticky have incorrect hostmap IP address.
This fixes when an IP address mapping is put in the hostmap table for
sticky NAT rules, it ends up having the wrong byte order.

Obtained from:	ipfilter CVS repo (r1.102), NetBSD CVS repo (r1.12)
2014-10-12 17:21:15 +00:00
cy
a223c6d9ec MFC r272554
ipfilter bug #534 destination list hashing not endian neutral

Obtained from:	ipfilter CVS repo (r1.26), NetBSD CVS repo (r1.8)
2014-10-12 17:19:11 +00:00
cy
159eb60806 MFC r272553
ipfilter bug #538 ipf_p_dns_del should return void

Obtained from:	ipfilter cvs repo (r1.8)
2014-10-12 17:17:19 +00:00
cy
647905f29a MFC r272552
ipfilter bug #554 Determining why a ipf rule matches is hard -- replace
ipfilter rule compare with new ipf_rule_compare() function.

Obtained from:	ipfilter CVS rep (r1.129)
2014-10-12 17:15:20 +00:00
cy
fea983df78 MFC r272551
ipfiler bug #550 filter rule list corrupted with inserted rules

Obtained from:	ipfilter CVS repo (r1.128); NetBSD CVS repo (r1.15)
2014-10-12 17:13:14 +00:00
cy
d487341bd7 MFC r272052
ipfilter bug #558 add in some missing frag table function comments.

Obtained from:	ipfilter CVS repo (r1.36)
2014-10-12 17:10:44 +00:00
cy
c5a5359e13 MFC r271980
Check for NULL before de-refencing; in particular sel is assigned to NULL,
in the default case, and then couple of lines down we do sel->

Obtained from:	NetBSD CVS repo (r1.5)
2014-10-12 17:08:44 +00:00
cy
2e9b5f450d MFC r271978
ipfilter bug #552 destination port not zero after parsing nat rule.

Obtained from:	netbsd CVS repo (r1.4), ipfilter CVS repo (r1.38)
2014-10-12 17:03:47 +00:00
cy
23579b38ee MFC r271977
3561691 gethost never returns an ipv6 address

Obtained from:	ipfilter CVS repo (r1.34), netbsd CVS repo (r1.4)
2014-10-12 16:58:45 +00:00
cy
60a2447c51 MFC r271974
ipfilter bug #551 ipf.conf address structure not properly zero filled.

Obtained from:	ipfilter CVS repo (r1.37), netbsd CVS repo (r1.3)
2014-10-12 16:55:26 +00:00