]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agosh: Fix LINENO and prompt after $'\0 and newline.
jilles [Fri, 3 Oct 2014 20:24:56 +0000 (20:24 +0000)]
sh: Fix LINENO and prompt after $'\0 and newline.

9 years agoAdd new fields in the FADT, required by IASL 20140926-64.
grehan [Fri, 3 Oct 2014 17:27:30 +0000 (17:27 +0000)]
Add new fields in the FADT, required by IASL 20140926-64.

The new IASL from the recent acpi-ca import will error out
if it doesn't see these new fields, which were previously
reserved.

Reported by: lme
Reviewed by: neel

9 years agoWhen we fail to get a USB reference we should just return, because
hselasky [Fri, 3 Oct 2014 16:09:46 +0000 (16:09 +0000)]
When we fail to get a USB reference we should just return, because
there are no more references held.

MFC after: 3 days

9 years agoFix XHCI driver for devices which have more than 15 physical root HUB
hselasky [Fri, 3 Oct 2014 15:58:04 +0000 (15:58 +0000)]
Fix XHCI driver for devices which have more than 15 physical root HUB
ports. The current bitmap array was too small to hold more than 16
bits and would at some point toggle the context size, which then would
trigger an enumeration fault and cause a fallback to the EHCI
companion controller, if any.

MFC after: 3 days

9 years agoAllow vld and vst instructions to use the canonical form from ARM ARM when
andrew [Fri, 3 Oct 2014 15:07:43 +0000 (15:07 +0000)]
Allow vld and vst instructions to use the canonical form from ARM ARM when
including an alignment. Previously binutils would only allow instructions
in the form "vld1.64 {d0, d1}, [r0, :128]" where the final comma should
not be there, instead the above instruction should be
"vld1.64 {d0, d1}, [r0:128]".

This change duplicates the alignment code from within the function to
handle this case.

9 years agoBump .Dd
lwhsu [Fri, 3 Oct 2014 15:03:44 +0000 (15:03 +0000)]
Bump .Dd

Approved by: kevlo

9 years agoFix various issues with zvols
smh [Fri, 3 Oct 2014 14:49:48 +0000 (14:49 +0000)]
Fix various issues with zvols

When performing snapshot renames we could deadlock due to the locking
in zvol_rename_minors. In order to avoid this use the same workaround
as zvol_open in zvol_rename_minors.

Add missing zvol_rename_minors to dsl_dataset_promote_sync.

Protect against invalid index into zv_name in zvol_remove_minors.

Replace zvol_remove_minor calls with zvol_remove_minors to ensure
any potential children are also renamed.

Don't fail zvol_create_minors if zvol_create_minor returns EEXIST.

Restore the valid pool check in zfs_ioc_destroy_snaps to ensure we
don't call zvol_remove_minors when zfs_unmount_snap fails.

PR: 193803
MFC after: 1 week
Sponsored by: Multiplay

9 years agoAdd all the dmb/dsb optional limitations, including the alternative values.
andrew [Fri, 3 Oct 2014 12:20:37 +0000 (12:20 +0000)]
Add all the dmb/dsb optional limitations, including the alternative values.
These are needed for some code llvm generates when targeting ARMv7.

9 years agoAllow the optional limitation on dmb instructions as is already the case
andrew [Fri, 3 Oct 2014 12:14:19 +0000 (12:14 +0000)]
Allow the optional limitation on dmb instructions as is already the case
with dsb instructions.

9 years agoFix autofs debug macros.
trasz [Fri, 3 Oct 2014 10:18:22 +0000 (10:18 +0000)]
Fix autofs debug macros.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoMake autofs(4) use shared lock for lookups, instead of exclusive one.
trasz [Fri, 3 Oct 2014 09:58:05 +0000 (09:58 +0000)]
Make autofs(4) use shared lock for lookups, instead of exclusive one.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoUPD and UDPLite require a checksum. So check for it.
tuexen [Fri, 3 Oct 2014 08:46:49 +0000 (08:46 +0000)]
UPD and UDPLite require a checksum. So check for it.

MFC after: 3 days

9 years agoFix a bug in r272297 which prevented dumpdev from setting.
hrs [Fri, 3 Oct 2014 04:13:25 +0000 (04:13 +0000)]
Fix a bug in r272297 which prevented dumpdev from setting.
!u is not equivalent to (u != 0).

9 years agoFix failures and warnings reported by newpynfs20090424 test tool.
araujo [Fri, 3 Oct 2014 02:24:41 +0000 (02:24 +0000)]
Fix failures and warnings reported by newpynfs20090424 test tool.
This fix addresses only issues with the pynfs reports, none of these
issues are know to create problems for extant real clients.

Submitted by: Bart Hsiao <bart.hsiao@gmail.com>
Reworked by: myself
Reviewed by: rmacklem
Approved by: rmacklem
Sponsored by: QNAP Systems Inc.

9 years agobump .Dd
kevlo [Fri, 3 Oct 2014 01:39:33 +0000 (01:39 +0000)]
bump .Dd

Reported by: gjb

9 years agoMention umoscom(4) and uslcom(4).
kevlo [Fri, 3 Oct 2014 01:20:49 +0000 (01:20 +0000)]
Mention umoscom(4) and uslcom(4).

9 years agoImport the NetBSD test suite from ^/vendor/NetBSD/tests/09.30.2014_20.45 ,
ngie [Thu, 2 Oct 2014 23:26:49 +0000 (23:26 +0000)]
Import the NetBSD test suite from ^/vendor/NetBSD/tests/09.30.2014_20.45 ,
minus the vendor Makefiles

Provide directions for how to bootstrap the vendor sources in
FREEBSD-upgrade

MFC after 2 weeks
Discussed with: rpaulo
Sponsored by: EMC / Isilon Storage Division

9 years agoRemove whitespace and 2 blank lines.
kargl [Thu, 2 Oct 2014 23:08:36 +0000 (23:08 +0000)]
Remove whitespace and 2 blank lines.

9 years agoHave dtrace(1) handle SIGPIPE by cleaning up and exiting. Additionally,
markj [Thu, 2 Oct 2014 22:33:35 +0000 (22:33 +0000)]
Have dtrace(1) handle SIGPIPE by cleaning up and exiting. Additionally,
install signal handlers when running in list mode (-l), and acknowledge
interrupts by cleaning up and exiting. This ensures that a command like

$ dtrace -l -P 'pid$target' -p <target PID> | less

won't cause the ptrace(2)d target process to be killed if less(1) exits
before all dtrace output is consumed.

Reported by: Anton Yuzhaninov <citrin+bsd@citrin.ru>
Differential Revision: https://reviews.freebsd.org/D880
Reviewed by: rpaulo
MFC after: 1 month
Sponsored by: EMC / Isilon Storage Division

9 years agoAdd HARDWARE section of urnis(4) driver to try to gain more visibility.
gavin [Thu, 2 Oct 2014 22:22:34 +0000 (22:22 +0000)]
Add HARDWARE section of urnis(4) driver to try to gain more visibility.

MFC after: 3 days

9 years agoFixup the setting of the baud rate.
gnn [Thu, 2 Oct 2014 22:05:48 +0000 (22:05 +0000)]
Fixup the setting of the baud rate.

9 years agoadd CAP_EVENT for the libpcap device so we will be able to use
luigi [Thu, 2 Oct 2014 21:34:52 +0000 (21:34 +0000)]
add CAP_EVENT for the libpcap device so we will be able to use
pcap--netmap which does poll() on the file descriptor

MFC after: 2 weeks

9 years agoRequire p_cansched() for changing a process' protection status via
jhb [Thu, 2 Oct 2014 21:18:16 +0000 (21:18 +0000)]
Require p_cansched() for changing a process' protection status via
procctl() rather than p_cansee().

Submitted by: rwatson
MFC after: 3 days

9 years agoRevert r272390.
hrs [Thu, 2 Oct 2014 20:17:16 +0000 (20:17 +0000)]
Revert r272390.

Pointed out by: glebius

9 years agoRemove obsolete Makefile for acpi.ko.
jkim [Thu, 2 Oct 2014 20:13:52 +0000 (20:13 +0000)]
Remove obsolete Makefile for acpi.ko.

9 years agoSeparate option handling from SIOC[SG]LAGG to SIOC[SG]LAGGOPTS for
hrs [Thu, 2 Oct 2014 20:01:13 +0000 (20:01 +0000)]
Separate option handling from SIOC[SG]LAGG to SIOC[SG]LAGGOPTS for
backward compatibility with old ifconfig(8).

9 years ago- Add a test for bug 191427 where pw(8) will go into an infinite loop
brd [Thu, 2 Oct 2014 19:53:37 +0000 (19:53 +0000)]
- Add a test for bug 191427 where pw(8) will go into an infinite loop

Reviewed by: will
MFC after: 1 month

9 years agoMerge ACPICA 20140926.
jkim [Thu, 2 Oct 2014 19:11:18 +0000 (19:11 +0000)]
Merge ACPICA 20140926.

9 years agostrptime(3): Update manpage for %U and %W.
pfg [Thu, 2 Oct 2014 18:52:29 +0000 (18:52 +0000)]
strptime(3): Update manpage for %U and %W.

%U and %W were implemented as part of r272273 so take them
out of the BUGS section and mention them in the SYNOPSIS.

MFC after: 1 month

9 years agoRemove the extra CFLAGS now that the driver has been fixed by jhb.
rpaulo [Thu, 2 Oct 2014 18:45:00 +0000 (18:45 +0000)]
Remove the extra CFLAGS now that the driver has been fixed by jhb.

9 years agostrptime: %s format fix.
pfg [Thu, 2 Oct 2014 18:33:58 +0000 (18:33 +0000)]
strptime: %s format fix.

Almost never needed in real life because %s is tends to be
only one format spec.
1) Return code of gmtime_r() is checked.
2) All flags are set.

Submitted by: ache
MFC after: 3 weeks

9 years agoMake sure we always set the maximum number of valid contexts.
hselasky [Thu, 2 Oct 2014 16:56:00 +0000 (16:56 +0000)]
Make sure we always set the maximum number of valid contexts.

MFC after: 3 days

9 years agovt(4): Save/restore keyboard mode & LED states when switching window
dumbbell [Thu, 2 Oct 2014 16:36:37 +0000 (16:36 +0000)]
vt(4): Save/restore keyboard mode & LED states when switching window

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@
MFC after: 3 days

9 years agoMerge the following revisions from ^/projects/release-vmimage:
gjb [Thu, 2 Oct 2014 16:13:12 +0000 (16:13 +0000)]
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.

MFC after: 5 days
X-MFC-10.1: yes
Tested on: r272269, r272272, r272279, r272380, r272392
Sponsored by: The FreeBSD Foundation

9 years agoProperly handle a case that should never happen (the bus_dma
gnn [Thu, 2 Oct 2014 15:03:51 +0000 (15:03 +0000)]
Properly handle a case that should never happen (the bus_dma
callback being called with error set to non-zero).

9 years agoAdd new USB ID.
hselasky [Thu, 2 Oct 2014 12:27:41 +0000 (12:27 +0000)]
Add new USB ID.

PR: 194091
MFC after: 3 days

9 years agoUse REPORT LUNS command for SPC-2 devices with LUN 0 disconnected.
mav [Thu, 2 Oct 2014 10:58:52 +0000 (10:58 +0000)]
Use REPORT LUNS command for SPC-2 devices with LUN 0 disconnected.

SPC-2 tells REPORT LUNS shall be supported by devices supporting LUNs other
then LUN 0.  If we see LUN 0 disconnected, guess there may be others, and
so REPORT LUNS shall be supported.

MFC after: 1 month

9 years agoCheck for UDP/IPv6 packets that the length in the UDP header is at least
tuexen [Thu, 2 Oct 2014 10:49:01 +0000 (10:49 +0000)]
Check for UDP/IPv6 packets that the length in the UDP header is at least
the minimum. Make the check similar to the one for UDPLite/IPv6.

MFC after: 3 days

9 years agoMake disconnected LUN 0 don't remain in half-configured state if there are
mav [Thu, 2 Oct 2014 10:39:07 +0000 (10:39 +0000)]
Make disconnected LUN 0 don't remain in half-configured state if there are
no LUNs on SPC-3 target after we tried REPORT LUNS.

9 years agoCall uma_zfree() outside of lock, and improve comment.
trasz [Thu, 2 Oct 2014 10:37:56 +0000 (10:37 +0000)]
Call uma_zfree() outside of lock, and improve comment.

Sponsored by: The FreeBSD Foundation

9 years agoFix the checksum computation for UDPLite/IPv6. This requires the
tuexen [Thu, 2 Oct 2014 10:32:24 +0000 (10:32 +0000)]
Fix the checksum computation for UDPLite/IPv6. This requires the
usage of a function computing the checksum only over a part of the function.
Therefore introduce in6_cksum_partial() and implement in6_cksum() based
on that.
While there, ensure that the UDPLite packet contains at least enough bytes
to contain the header.

Reviewed by: kevlo
MFC after: 3 days

9 years agoMake autofs timeout handling use timeout task instead of callout;
trasz [Thu, 2 Oct 2014 10:31:32 +0000 (10:31 +0000)]
Make autofs timeout handling use timeout task instead of callout;
that's because the handler can sleep on sx lock.

Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

9 years agoRestore CAM_QUIRK_NOLUNS check, lost in previous commit.
mav [Thu, 2 Oct 2014 10:02:38 +0000 (10:02 +0000)]
Restore CAM_QUIRK_NOLUNS check, lost in previous commit.

MFC after: 1 month

9 years agoRework the logic of sequential SCSI LUN scanner.
mav [Thu, 2 Oct 2014 09:42:11 +0000 (09:42 +0000)]
Rework the logic of sequential SCSI LUN scanner.

Previous logic was not differentiating disconnected LUNs and absent targets.
That made it to stop scan if LUN 0 was not found for any reason.  That made
problematic, for example, using iSCSI targets declaring SPC-2 compliance and
having no LUN 0 configured.

The new logic continues sequential LUN scan if:
 -- we have more configured LUNs that need recheck;
 -- this LUN is connected and its SCSI version allows more LUNs;
 -- this LUN is disconnected, its SCSI version allows more LUNs and we
    guess they may be connected (we haven't scanned first 8 LUNs yet or
    kern.cam.cam_srch_hi sysctl is set to scan more).

Reported by: trasz
MFC after: 1 month

9 years agoAdd uart driver for Qualcomm MSM 7000/8000 series chips.
ganbold [Thu, 2 Oct 2014 08:12:42 +0000 (08:12 +0000)]
Add uart driver for Qualcomm MSM 7000/8000 series chips.
It is working on IFC6410 board which has Qualcomm Snapdragon SoC.

Approved by:    stas (mentor)

9 years agoMake sure to not skip any argument when converting from deprecated
bapt [Thu, 2 Oct 2014 06:29:49 +0000 (06:29 +0000)]
Make sure to not skip any argument when converting from deprecated
+POS1, -POS2 to -kPOS1,POS2, so that sort +0n gets translated to sort -k1,1n
as it is expected

PR: 193994
Submitted by: rodrigo
MFC after: 3 days

9 years agoAllow timer0 to run at full 24MHz not at 24MHz/16 by setting prescale to 1.
ganbold [Thu, 2 Oct 2014 06:00:55 +0000 (06:00 +0000)]
Allow timer0 to run at full 24MHz not at 24MHz/16 by setting prescale to 1.

Approved by:    stas (mentor)

9 years agoVirtualize net.link.vlan.soft_pad.
hrs [Thu, 2 Oct 2014 05:56:17 +0000 (05:56 +0000)]
Virtualize net.link.vlan.soft_pad.

9 years agoGet rid of code that dealt with the hardware not being able to save/restore
neel [Thu, 2 Oct 2014 05:32:29 +0000 (05:32 +0000)]
Get rid of code that dealt with the hardware not being able to save/restore
the PAT MSR on guest exit/entry. This workaround was done for a beta release
of VMware Fusion 5 but is no longer needed in later versions.

All Intel CPUs since Nehalem have supported saving and restoring MSR_PAT
in the VM exit and entry controls.

Discussed with: grehan

9 years agoDo not strip outer header when operating in transport mode.
ae [Thu, 2 Oct 2014 02:00:21 +0000 (02:00 +0000)]
Do not strip outer header when operating in transport mode.
Instead requeue mbuf back to IPv4 protocol handler. If there is one extra IP-IP
encapsulation, it will be handled with tunneling interface. And thus proper
interface will be exposed into mbuf's rcvif. Also, tcpdump that listens on tunneling
interface will see packets in both directions.

Sponsored by: Yandex LLC

9 years agoResurrect set_rcvar() as a function to define a rc.conf variable.
hrs [Thu, 2 Oct 2014 01:16:30 +0000 (01:16 +0000)]
Resurrect set_rcvar() as a function to define a rc.conf variable.
It defines a variable and its default value in load_rc_config() just after
rc.conf is loaded.  "rcvar" command shows the current and the default values.

This is an attempt to solve a problem that rc.d scripts from third-party
software do not have entries in /etc/defaults/rc.conf.  The fact that
load_rc_config() reads rc.conf only once and /etc/rc invokes the function
before running rc.d scripts made developers confused for a long time because
load_rc_config() just before run_rc_command() in each rc.d script overrides
variables only when the script is directly invoked, not from /etc/rc.

Variables defined in set_rcvar are always set in load_rc_config() after
loading rc.conf.  An rc.d script can now be written in a self-contained
manner regarding the related variables as follows:

---
name=foo
rcvar=foo_enable

set_rcvar foo_enable YES "Enable $name"
set_rcvar foo_flags "-s" "Flags to $name"

...

load_rc_config $name
run_rc_command "$@"
---

9 years agoAdd an additional routing table lookup when m->m_pkthdr.fibnum is changed
hrs [Thu, 2 Oct 2014 00:25:57 +0000 (00:25 +0000)]
Add an additional routing table lookup when m->m_pkthdr.fibnum is changed
at a PFIL hook in ip{,6}_output().  IPFW setfib rule did not perform
a routing table lookup when the destination address was not changed.

CR: D805

9 years agoAdd IFCAP_HWSTATS.
hrs [Thu, 2 Oct 2014 00:19:24 +0000 (00:19 +0000)]
Add IFCAP_HWSTATS.

9 years agoDiff reduction with kernel code: instruct the compiler that the data of
delphij [Thu, 2 Oct 2014 00:13:08 +0000 (00:13 +0000)]
Diff reduction with kernel code: instruct the compiler that the data of
these types may be unaligned to their "normal" alignment and exercise
caution when accessing them.

PR: 194071
MFC after: 3 days

9 years agostrptime: fix bug introduced in r272273.
pfg [Wed, 1 Oct 2014 22:18:07 +0000 (22:18 +0000)]
strptime: fix bug introduced in r272273.

Reported by: portmgr (antoine)
Fix by: Andrey Chernov, David Carlier
PR: 137307 (follow up)

9 years agoVirtualize lagg(4) cloner. This change fixes a panic when tearing down
hrs [Wed, 1 Oct 2014 21:37:32 +0000 (21:37 +0000)]
Virtualize lagg(4) cloner.  This change fixes a panic when tearing down
if_lagg(4) interfaces which were cloned in a vnet jail.

Sysctl nodes which are dynamically generated for each cloned interface
(net.link.lagg.N.*) have been removed, and use_flowid and flowid_shift
ifconfig(8) parameters have been added instead.  Flags and per-interface
statistics counters are displayed in "ifconfig -v".

CR: D842

9 years agoFree radix mask entries on main radix destroy.
melifaro [Wed, 1 Oct 2014 21:24:58 +0000 (21:24 +0000)]
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
Submitted by: Rumen Telbizov
MFC after: 3 days

9 years agoImprove performance of mking(1) by keeping a list of "chunks" in memory,
marcel [Wed, 1 Oct 2014 21:03:17 +0000 (21:03 +0000)]
Improve performance of mking(1) by keeping a list of "chunks" in memory,
that keeps track of a particular region of the image. In particular the
image_data() function needs to return to the caller whether a region
contains data or is all zeroes. This required reading the region from
the temporary file and comparing the bytes. When image_data() is used
multiple times for the same region, this will get painful fast.

With a chunk describing a region of the image, we now also have a way
to refer to the image provided on the command line. This means we don't
need to copy the image into a temporary file. We just keep track of the
file descriptor and offset within the source file on a per-chunk basis.

For streams (pipes, sockets, fifos, etc) we now use the temporary file
as a swap file. We read from the input file and create a chunk of type
"zeroes" for each sequence of zeroes that's a multiple of the sector
size. Otherwise, we allocte from the swap file, mmap(2) it, read into
the mmap(2)'d memory and create a chunk representing data.

For regular files, we use SEEK_HOLE and SEEK_DATA to handle sparse files
eficiently and create a chunk of type zeroes for holes and a chunk of
type data for data regions. For data regions, we still compare the bytes
we read to handle differences between a file system's block size and our
sector size.

After reading all files, image_write() is used by schemes to scribble in
the reserved sectors. Since this never amounts to much, keep this data
in memory in chunks of exactly 1 sector.

The output image is created by looking using the chunk list to find the
data and write it out to the output file. For chunks of type "zeroes"
we prefer to seek, but fall back to writing zeroes to handle pipes.
For chunks of type "file" and "memoty" we simply write.

The net effect of this is that for reasonably large images the execution
time drops from 1-2 minutes to 10-20 seconds. A typical speedup is about
5 to 8 times, depending on partition sizes, output format whether in
input files are sparse or not.

Bump version to 20141001.

9 years agoRevise r272363 by collapsing the tests into a for loop.
will [Wed, 1 Oct 2014 20:52:08 +0000 (20:52 +0000)]
Revise r272363 by collapsing the tests into a for loop.

This has the side effect of ensuring that realpath is also run for the
nominal case of PORTSDIR=/usr/ports (assuming .CURDIR is a ports directory
that relies on /usr/ports but is not rooted in it).  This ensures that any
generated PORTSDIR used is always the actual location.

Submitted by: jkim (different implementation)

9 years agoSuffix the cookie constants with ULL to silence warnings from compilers
marcel [Wed, 1 Oct 2014 20:37:15 +0000 (20:37 +0000)]
Suffix the cookie constants with ULL to silence warnings from compilers
that try to treat them as 32-bit values.

9 years agoOptimize program flow for execution speed. Also fix some more style(9) nits
dteske [Wed, 1 Oct 2014 18:59:57 +0000 (18:59 +0000)]
Optimize program flow for execution speed. Also fix some more style(9) nits
while here:
+ Fix an issue when extracting small archives where dialog_mixedgauge was
  not rendering; leaving the user wondering if anything happened.
+ Add #ifdef's to assuage compilation against older libarchive
  NB: Minimize diff between branches; make merging easier.
+ Add missing calls to end_dialog(3)
+ Change string processing from strtok(3) to strcspn(3) (O(1) optimization)
+ Use EXIT_SUCCESS and EXIT_FAILURE instead of 0/1
+ Optimize getenv(3) use, using stored results instead of calling repeatedly
  NB: Fixes copy/paste error wherein we display getenv(BSDINSTALL_DISTDIR) in
      an error msgbox when chdir(2) to getenv(BSDINSTALL_CHROOT) fails
      (wrong variable displayed in msgbox).
+ Use strtol(3) instead of [deprecated] atoi(3)
+ Add additional error checking (e.g., check return of archive_read_new(3))
+ Assign DECONST strings to static variables
+ Fix typo in distextract.c error message (s/Could could/Could not/)
+ Add comments and make a minor whitespace adjustment

Reviewed by: nwhitehorn, julian

9 years agoAdd a sysctl, net.inet.icmp.tstamprepl, which can be used to disable replies
markj [Wed, 1 Oct 2014 18:07:34 +0000 (18:07 +0000)]
Add a sysctl, net.inet.icmp.tstamprepl, which can be used to disable replies
to ICMP Timestamp packets.

PR: 193689
Submitted by: Anthony Cornehl <accornehl@gmail.com>
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division

9 years agoSome cleanup for sfxge.4
bjk [Wed, 1 Oct 2014 17:16:18 +0000 (17:16 +0000)]
Some cleanup for sfxge.4

Use standard mdoc macros instead of pure roff, fix some other mdoc usage,
make the style consistent, and fix some grammar issues.

Approved by: hrs (mentor)

9 years agoSeparate release/scripts/mk-vmimage.sh to machine-specific
gjb [Wed, 1 Oct 2014 17:05:40 +0000 (17:05 +0000)]
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.

Sponsored by: The FreeBSD Foundation

9 years agoEmbellish a comment regarding the reliability of DEBUG_VFS_LOCKS.
will [Wed, 1 Oct 2014 16:16:01 +0000 (16:16 +0000)]
Embellish a comment regarding the reliability of DEBUG_VFS_LOCKS.

Submitted by: kib

9 years agoClean up detection of hard-float ABIs. As with big-endian in r272368 we
andrew [Wed, 1 Oct 2014 16:08:19 +0000 (16:08 +0000)]
Clean up detection of hard-float ABIs. As with big-endian in r272368 we
can check against arm*hf*.

9 years agoClean up detection of big-endian ARM. In all cases we follow the pattern
andrew [Wed, 1 Oct 2014 16:00:21 +0000 (16:00 +0000)]
Clean up detection of big-endian ARM. In all cases we follow the pattern
arm*eb*. Check we are building for arm and if MACHINE_ARCH follows this
pattern.

9 years agoInstead of requiring an edit to turn on ZFS debugging, define ZFS_DEBUG.
will [Wed, 1 Oct 2014 15:34:48 +0000 (15:34 +0000)]
Instead of requiring an edit to turn on ZFS debugging, define ZFS_DEBUG.

MFC after: 1 month

9 years agoIn the syncer, drop the sync mutex while patting the watchdog.
will [Wed, 1 Oct 2014 15:32:28 +0000 (15:32 +0000)]
In the syncer, drop the sync mutex while patting the watchdog.

Some watchdog drivers (like ipmi) need to sleep while patting the watchdog.
See sys/dev/ipmi/ipmi.c:ipmi_wd_event(), which calls malloc(M_WAITOK).

Submitted by: asomers
MFC after: 1 month
Sponsored by: Spectra Logic
MFSpectraBSD: 637548 on 2012/10/04

9 years agoAlways resolve PORTSDIR to absolute paths using realpath(1).
will [Wed, 1 Oct 2014 15:02:37 +0000 (15:02 +0000)]
Always resolve PORTSDIR to absolute paths using realpath(1).

Reported by: madpilot
Reviewed by: bapt
X-MFC-With: 272282

9 years agoEnsure that every ENTRY(foo) has a matching END(foo).
bapt [Wed, 1 Oct 2014 15:00:21 +0000 (15:00 +0000)]
Ensure that every ENTRY(foo) has a matching END(foo).
It allows to build with newer binutils

Differential Revision: https://reviews.freebsd.org/D877
Reviewed by: jhibbits

9 years agoRemove lock init from radix.c.
melifaro [Wed, 1 Oct 2014 14:39:06 +0000 (14:39 +0000)]
Remove lock init from radix.c.
Radix has never managed its locking itself.
The only consumer using radix with embeded rwlock
is system routing table. Move per-AF lock inits there.

9 years agoAdd sysctl to track the resource consumption of ACPI interrupts.
will [Wed, 1 Oct 2014 14:35:52 +0000 (14:35 +0000)]
Add sysctl to track the resource consumption of ACPI interrupts.

Submitted by: gibbs
MFC after: 1 month
Sponsored by: Spectra Logic
MFSpectraBSD: 636827 on 2012/09/28

9 years agozfsvfs_create(): Refuse to mount datasets whose names are too long.
will [Wed, 1 Oct 2014 14:12:02 +0000 (14:12 +0000)]
zfsvfs_create(): Refuse to mount datasets whose names are too long.

This is checked for in the zfs_snapshot_004_neg STF/ATF test (currently
still in projects/zfsd rather than head).

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c:
- zfsvfs_create(): Check whether the objset name fits into
  statfs.f_mntfromname, and return ENAMETOOLONG if not.  Although
  the filesystem can be unmounted via the umount(8) command, any
  interface that relies on iterating on statfs (e.g. libzfs) will
  fail to find the filesystem by its objset name, and thus assume
  it's not mounted.  This causes "zfs unmount", "zfs destroy",
  etc. to fail on these filesystems, whether or not -f is passed.

MFC after: 1 month
Sponsored by: Spectra Logic
MFSpectraBSD: 974872 on 2013/08/09

9 years agoUse rn_detachhead() instead of direct free(9) for radix tables.
glebius [Wed, 1 Oct 2014 13:35:41 +0000 (13:35 +0000)]
Use rn_detachhead() instead of direct free(9) for radix tables.

Sponsored by: Nginx, Inc.

9 years agoFix the TARGET_ABI value clang uses. It shpuld be gnueabi on all ARM
andrew [Wed, 1 Oct 2014 12:47:25 +0000 (12:47 +0000)]
Fix the TARGET_ABI value clang uses. It shpuld be gnueabi on all ARM
soft-float architectures, and gnueabihf for hard-float.

9 years agoSplit you the syscall handling to a separate file.
andrew [Wed, 1 Oct 2014 12:44:16 +0000 (12:44 +0000)]
Split you the syscall handling to a separate file.

9 years agoFix couple issues with ROD tokens content.
mav [Wed, 1 Oct 2014 11:30:20 +0000 (11:30 +0000)]
Fix couple issues with ROD tokens content.

MFC after: 3 days

9 years agoFix off by one in lagg_port_destroy().
glebius [Wed, 1 Oct 2014 11:23:54 +0000 (11:23 +0000)]
Fix off by one in lagg_port_destroy().

Reported by: "Max N. Boyarov" <zotrix bsd.by>

9 years agoRemove MK_ARM_EABI, the armeb issues have been fixed. The code to support
andrew [Wed, 1 Oct 2014 08:26:51 +0000 (08:26 +0000)]
Remove MK_ARM_EABI, the armeb issues have been fixed. The code to support
the oabi is still in the tree, but it is expected this will be removed
as developers work on surrounding code.

With this commit the ARM EABI is the only supported supported ABI by
FreeBSD on ARMa 32-bit processors.

X-MFC after: never
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D876

9 years agoSet default cycle state in case of early interrupts.
hselasky [Wed, 1 Oct 2014 07:34:49 +0000 (07:34 +0000)]
Set default cycle state in case of early interrupts.

MFC after: 3 days

9 years agoConsistently cast tty and user to const char * in printf()-like contexts.
des [Wed, 1 Oct 2014 07:15:02 +0000 (07:15 +0000)]
Consistently cast tty and user to const char * in printf()-like contexts.

9 years agoThe default for UDPLITE_RECV_CSCOV is zero. RFC 3828 recommend
tuexen [Wed, 1 Oct 2014 05:43:29 +0000 (05:43 +0000)]
The default for UDPLITE_RECV_CSCOV is zero. RFC 3828 recommend
that this means full checksum coverage for received packets.
If an application is willing to accept packets with partial
coverage, it is expected to use the socekt option and provice
the minimum coverage it accepts.

Reviewed by: kevlo
MFC after: 3 days

9 years agoCorrect the way that libelf is linked when USDT is used.
markj [Wed, 1 Oct 2014 04:28:39 +0000 (04:28 +0000)]
Correct the way that libelf is linked when USDT is used.

9 years agoTag ^/base/vendor/NetBSD/tests/09.30.2014_20.45 from
ngie [Wed, 1 Oct 2014 04:12:38 +0000 (04:12 +0000)]
Tag ^/base/vendor/NetBSD/tests/09.30.2014_20.45 from
^/base/vendor/NetBSD/tests/dist

Sponsored by: EMC / Isilon Storage Division

9 years agoCheck in first src/tests snapshot from NetBSD anoncvs
ngie [Wed, 1 Oct 2014 04:07:17 +0000 (04:07 +0000)]
Check in first src/tests snapshot from NetBSD anoncvs

Sources were obtained like so:

% export CVSROOT="anoncvs@anoncvs.NetBSD.org:/cvsroot"
% cvs -z9 co -D "09/30/2014 20:45" -P src/tests
% mv src/tests/* tests/dist/.

'*CVS*' has been added to svn:ignore to ease updating periodically from
upstream

Some line ending issues had to be resolved with test outputs and scripts
via dos2unix and by deleting the eol-style property set in usr.bin/sort

Discussed with: rpaulo
Sponsored by: EMC / Isilon Storage Division

9 years agoAdd ObsoleteFiles.inc OLD_FILES entries for libnv
ngie [Wed, 1 Oct 2014 01:56:51 +0000 (01:56 +0000)]
Add ObsoleteFiles.inc OLD_FILES entries for libnv

X-MFC with: r271241
Submitted by: pjd
Pointyhat to: ngie
Sponsored by: EMC / Isilon Storage Division

9 years agoTest for absence of M_NOFREE before attempting to purge the mbuf's tags.
np [Tue, 30 Sep 2014 23:16:26 +0000 (23:16 +0000)]
Test for absence of M_NOFREE before attempting to purge the mbuf's tags.
This will leave more state intact should the assertion go off.

MFC after: 1 month

9 years agoReturn the actual baud rate programmed in the hardware rather than 115200.
ian [Tue, 30 Sep 2014 23:01:11 +0000 (23:01 +0000)]
Return the actual baud rate programmed in the hardware rather than 115200.
This allows the "3wire" entry in /etc/ttys (with no speed specified) to work.

9 years agoWhen building the lists of available memory, actually honor the exclusion
ian [Tue, 30 Sep 2014 21:28:05 +0000 (21:28 +0000)]
When building the lists of available memory, actually honor the exclusion
flags, like the comment says it does.

Pointy hat: ian
Submitted by: Svatopluk Kraus <onwahe@gmail.com>

9 years agoSupport tunable to control Tx deferred packet list limits
gnn [Tue, 30 Sep 2014 20:57:25 +0000 (20:57 +0000)]
Support tunable to control Tx deferred packet list limits

Also increase default for Tx queue get-list limit.
Too small limit results in TCP packets drops especiall when many
streams are running simultaneously.
Put list may be kept small enough since it is just a temporary
location if transmit function can't get Tx queue lock.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

9 years agoThe patch allows to check state of the software Tx queues at run time.
gnn [Tue, 30 Sep 2014 20:43:21 +0000 (20:43 +0000)]
The patch allows to check state of the software Tx queues at run time.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

9 years agoUpdate SolarFlare driver manual page with new tunables.
gnn [Tue, 30 Sep 2014 20:38:36 +0000 (20:38 +0000)]
Update SolarFlare driver manual page with new tunables.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

9 years agoMake size of Tx and Rx rings configurable
gnn [Tue, 30 Sep 2014 20:36:07 +0000 (20:36 +0000)]
Make size of Tx and Rx rings configurable

Required size of event queue is calculated now.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

9 years agoUDPLite requires a checksum. Therefore, discard a received packet if
tuexen [Tue, 30 Sep 2014 20:29:58 +0000 (20:29 +0000)]
UDPLite requires a checksum. Therefore, discard a received packet if
the checksum is 0.

MFC after: 3 days

9 years agocleanup: code style fixes
gnn [Tue, 30 Sep 2014 20:18:10 +0000 (20:18 +0000)]
cleanup: code style fixes

Remove trailing whitespaces and tabs.
Enclose value in return statements in parentheses.
Use tabs after #define.
Do not skip comparison with 0/NULL in boolean expressions.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

9 years agoFix a mismerge in r260183 which prevents snapshot zvol devices being
delphij [Tue, 30 Sep 2014 18:50:45 +0000 (18:50 +0000)]
Fix a mismerge in r260183 which prevents snapshot zvol devices being
removed and re-instate the fix in r242862.

Reported by: Leon Dang <ldang nahannisys com>, smh
MFC after: 3 days

9 years agoIf the checksum coverage field in the UDPLITE header is the length
tuexen [Tue, 30 Sep 2014 18:17:28 +0000 (18:17 +0000)]
If the checksum coverage field in the UDPLITE header is the length
of the complete UDPLITE packet, the packet has full checksum coverage.
SO fix the condition.

Reviewed by: kevlo
MFC after: 3 days

9 years agoxen: fix blkback pushing responses before releasing internal resources
royger [Tue, 30 Sep 2014 17:41:16 +0000 (17:41 +0000)]
xen: fix blkback pushing responses before releasing internal resources

Fix a problem where the blockback driver could run out of requests,
despite the fact that we allocate enough request and reqlist
structures to satisfy the maximum possible number of requests.

The problem was that we were sending responses back to the other
end (blockfront) before freeing resources. The Citrix Windows
driver is pretty agressive about queueing, and would queue more I/O
to us immediately after we sent responses to it. We would run into
a resource shortage and stall out I/O until we freed resources.

It isn't clear whether the request shortage condition was an
indirect cause of the I/O hangs we've been seeing between Windows
with the Citrix PV drivers and FreeBSD's blockback, but the above
problem is certainly a bug.

Sponsored by: Spectra Logic
Submitted by: ken
Reviewed by: royger

dev/xen/blkback/blkback.c:
 - Break xbb_send_response() into two sub-functions,
   xbb_queue_response() and xbb_push_responses().
   Remove xbb_send_response(), because it is no longer
   used.

 - Adjust xbb_complete_reqlist() so that it calls the
   two new functions, and holds the mutex around both
   calls.  The mutex insures that another context
   can't come along and push responses before we've
   freed our resources.

 - Change xbb_release_reqlist() so that it requires
   the mutex to be held instead of acquiring the mutex
   itself.  Both callers could easily hold the mutex
   while calling it, and one really needs to hold the
   mutex during the call.

 - Add two new counters, accessible via sysctl
   variables.  The first one counts the number of
   I/Os that are queued and waiting to be pushed
   (reqs_queued_for_completion).  The second one
   (reqs_completed_with_error) counts the number of
   requests we've completed with an error status.

9 years agoxen/balloon: fix accounting of current memory pages on PVH
royger [Tue, 30 Sep 2014 17:38:21 +0000 (17:38 +0000)]
xen/balloon: fix accounting of current memory pages on PVH

Using realmem on PVH is not realiable, since in this case the realmem value
is computed from Maxmem, which contains the higher memory address found. Use
HYPERVISOR_start_info->nr_pages instead, which is set by the hypervisor and
contains the exact number of memory pages assigned to the domain.

Sponsored by: Citrix Systems R&D