]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r310092:
brooks [Wed, 21 Dec 2016 22:04:44 +0000 (22:04 +0000)]
MFC r310092:

Add a free_iovec() function to reset iovec's.

The primary purpose is to call nmount() in a loop with new iovec's so
free_iovec takes arguments by reference and resets their values.

Reviewed by: cem
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8513

7 years agoMFC r307521: libmd: introduce functions that operate on fd instead of filename
emaste [Wed, 21 Dec 2016 18:42:04 +0000 (18:42 +0000)]
MFC r307521: libmd: introduce functions that operate on fd instead of filename

7 years agoMFC r310132:
pfg [Wed, 21 Dec 2016 15:38:28 +0000 (15:38 +0000)]
MFC r310132:
libbfd: make sure variables are initialized before using them.

Initialize l_sec_contents to make sure that free(l_sec_contents) is called
on valid pointers.

Obtained from: OpenBSD (partial CVS rev 1.18)

7 years agoMFC r310205:
kib [Wed, 21 Dec 2016 09:22:06 +0000 (09:22 +0000)]
MFC r310205:
Fix typo.  Remove spurious blank line.

7 years agoMFC r310098:
kib [Wed, 21 Dec 2016 09:18:53 +0000 (09:18 +0000)]
MFC r310098:
Provide introductory description of the default pager.

7 years agoMFC r310097:
kib [Wed, 21 Dec 2016 09:15:25 +0000 (09:15 +0000)]
MFC r310097:
Remove locking around accounting initialization of the default object.

7 years agoMFC: 309669
gnn [Tue, 20 Dec 2016 19:30:21 +0000 (19:30 +0000)]
MFC: 309669

Fix a kernel panic in DTrace's rw_iswriter subroutine.
On FreeBSD the sense of rw_write_held() and rw_iswriter() were reversed,
probably due to a cut and paste error. Using rw_iswriter() would cause
the kernel to panic.

Reviewed by: markj
Sponsored by: DARPA, AFRL

7 years agoMFC: 309069
gnn [Tue, 20 Dec 2016 16:37:45 +0000 (16:37 +0000)]
MFC: 309069

Add tunable to disable destructive dtrace

Submitted by: Joerg Pernfuss <code.jpe@gmail.com>
Reviewed by: rstone, markj

7 years agoMFC r309650:
ed [Tue, 20 Dec 2016 07:42:15 +0000 (07:42 +0000)]
MFC r309650:

  Properly sign extend the result of jrand48() and mrand48().

  These functions are supposed to return a value between [-2^31, 2^31).
  This doesn't seem to work on 64-bit systems, where we return a value
  between [0, 3^32). Patch up the function to use proper casts to int32_t.
  While there, fix some other style bugs.

7 years agoMFC: r309566
rmacklem [Mon, 19 Dec 2016 22:15:29 +0000 (22:15 +0000)]
MFC: r309566
Fix the NFSv4.1 server for Open reclaim after a reboot.

The NFSv4.1 server failed to update the nfs-stablerestart file for
a client when the client was issued its first Open. As such, recovery
of Opens after a server reboot failed with NFSERR_NOGRACE.
This patch fixes this.
It also changes the code so that it malloc()'s the 1024 byte array
instead of allocating it on the kernel stack for both NFSv4.0 and NFSv4.1.
Note that this bug only affected NFSv4.1 and only when clients attempted
to reclaim Opens after a server reboot.

7 years agoMFC r310160
lifanov [Mon, 19 Dec 2016 19:37:55 +0000 (19:37 +0000)]
MFC r310160

retain cc.4.gz man page for Chelsio T6 NICs

This man page was removed in r225583 when cc.4 was renamed to mod_cc.4
With reintroduction of cc.4 "make installworld; make delete-old" was
no longer convergent.

Reviewed by: matthew
Approved by: jhb (implicit), matthew (mentor)
Differential Revision: https://reviews.freebsd.org/D8828

7 years agoMFC r307902:
trasz [Mon, 19 Dec 2016 17:05:24 +0000 (17:05 +0000)]
MFC r307902:

Make the USB attach strings in dmesg include product name.

7 years agoMFC r307774:
trasz [Mon, 19 Dec 2016 17:02:55 +0000 (17:02 +0000)]
MFC r307774:

Fix libusb20_dev_get_desc(3) to use the "vendor product" order, not
"product vendor". This is consistent with how it's generally done.

The ordering is visible eg in usbconfig(8) output.

7 years agoMFC r306095:
trasz [Mon, 19 Dec 2016 12:27:01 +0000 (12:27 +0000)]
MFC r306095:

Make the "r/s" and "w/s" fields in "iostat -x" a little bit wider;
five chars is way too narrow for todays disks.

7 years agoMFC r308386:
trasz [Mon, 19 Dec 2016 12:25:30 +0000 (12:25 +0000)]
MFC r308386:

Document that getfsstat(2) called with MNT_NOWAIT skips file systems
that are in the process of being unmounted.

7 years agoMFC r308611:
trasz [Mon, 19 Dec 2016 12:22:32 +0000 (12:22 +0000)]
MFC r308611:

Remove spurious space.

7 years agoMFC r308637:
trasz [Mon, 19 Dec 2016 12:20:58 +0000 (12:20 +0000)]
MFC r308637:

Fix function prototypes in usbdi(9) man page, and tweak it a little.

7 years agoMFC r309400:
hselasky [Mon, 19 Dec 2016 09:51:17 +0000 (09:51 +0000)]
MFC r309400:
Fix for endless recursion in the ACPI GPE handler during boot.

When handling a GPE ACPI interrupt object the EcSpaceHandler()
function can be called which checks the EC_EVENT_SCI bit and then
recurse on the EcGpeQueryHandler() function. If there are multiple GPE
events pending the EC_EVENT_SCI bit will be set at the next call to
EcSpaceHandler() causing it to recurse again via the
EcGpeQueryHandler() function. This leads to a slow never ending
recursion during boot which prevents proper system startup, because
the EC_EVENT_SCI bit never gets cleared in this scenario.

The behaviour is reproducible with the ALASKA AMI in combination with
a newer Skylake based mainboard in the following way:

Enter BIOS and adjust the clock one hour forward. Save and exit the
BIOS. System fails to boot due to the above mentioned bug in
EcGpeQueryHandler() which was observed recursing multiple times.

This patch adds a simple recursion guard to the EcGpeQueryHandler()
function and also also adds logic to detect if new GPE events occurred
during the execution of EcGpeQueryHandler() and then loop on this
function instead of recursing.

Reviewed by: jhb

7 years agoMFC r309737:
hselasky [Mon, 19 Dec 2016 09:49:16 +0000 (09:49 +0000)]
MFC r309737:
Add more LinuxKPI PCI definitions.

Obtained from: kmacy @
Sponsored by: Mellanox Technologies

7 years agoMFC r309736:
hselasky [Mon, 19 Dec 2016 09:48:29 +0000 (09:48 +0000)]
MFC r309736:
Prefer function macros over regular macros in the LinuxKPI.

Sponsored by: Mellanox Technologies

7 years agoMFC r309732:
hselasky [Mon, 19 Dec 2016 09:47:34 +0000 (09:47 +0000)]
MFC r309732:
Prefix some _pci_xxx() functions in the Linux KPI with linux_ and make
sure the IRQ number used by these functions is unsigned.

Sponsored by:           Mellanox Technologies

7 years agoMFC r309404:
hselasky [Mon, 19 Dec 2016 09:44:14 +0000 (09:44 +0000)]
MFC r309404:
Fix return value from ng_uncallout().

callout_stop() recently started returning -1 when the callout is already
stopped, which is not handled by the netgraph code. Properly filter
the return value. Netgraph callers only want to know if the callout
was cancelled and not draining or already stopped.

Discussed with: julian, glebius

7 years agoMFC r309731:
hselasky [Mon, 19 Dec 2016 09:42:43 +0000 (09:42 +0000)]
MFC r309731:
Prefix the Linux KPI's kmem_xxx() functions with linux_ to avoid
conflict with the opensolaris kernel module.

This patch solves a problem where the kernel linker will incorrectly
resolve opensolaris kmem_xxx() functions as linuxkpi ones, which leads
to a panic when these functions are used.

Submitted by: gallatin @
Sponsored by:           Mellanox Technologies

7 years agoMFC r309733:
hselasky [Mon, 19 Dec 2016 09:41:49 +0000 (09:41 +0000)]
MFC r309733:
MSIX can support more than 256 IRQs. Make sure the invalid IRQ number
set in the LinuxKPI is big enough.

Sponsored by:           Mellanox Technologies

7 years agoMFC r309734:
hselasky [Mon, 19 Dec 2016 09:40:29 +0000 (09:40 +0000)]
MFC r309734:
Avoid malloc() warnings when using the LinuxKPI by zero-checking
the allocation flags.

Obtained from: kmacy @
Sponsored by:           Mellanox Technologies

7 years agoMFC r309406:
hselasky [Mon, 19 Dec 2016 09:32:29 +0000 (09:32 +0000)]
MFC r309406:
Remove useless NULL checks.

NULL is not returned when allocating memory passing the M_WAITOK flag.

Submitted by: trasz @
Differential Revision:  https://reviews.freebsd.org/D5772
Sponsored by:           Mellanox Technologies

7 years agoMFC r308708: Reduce verbosity of warnings about truncating NFS fileids to
cperciva [Mon, 19 Dec 2016 07:48:04 +0000 (07:48 +0000)]
MFC r308708: Reduce verbosity of warnings about truncating NFS fileids to
32-bit inode numbers.

7 years agoMFC r310179:
cperciva [Mon, 19 Dec 2016 07:46:20 +0000 (07:46 +0000)]
MFC r310179:
Avoid division by zero in the rare case that portsnap needs to fetch
zero patches.  (This avoids two "dc: divide by zero" warnings.)

7 years agoMFC r310155:
kib [Mon, 19 Dec 2016 00:26:25 +0000 (00:26 +0000)]
MFC r310155:
Fix typo.

7 years agoMFC r310089:
avos [Sun, 18 Dec 2016 20:59:24 +0000 (20:59 +0000)]
MFC r310089:
ifconfig: do not truncate SSID in verbose mode.

Fix 32-character SSID abbreviation for 'ifconfig -v wlan0 scan' command.

PR: 215301
Submitted by: <ms-freebsd-bugzilla@stoffnet.at>

7 years agoMFC r309534:
avos [Sun, 18 Dec 2016 20:40:22 +0000 (20:40 +0000)]
MFC r309534:
Do not try to recreate wlan(4) interface if it already exists.

This should fix error messages caused by devd(8) during startup:

Starting Network: lo0 wlan0.
...
Starting devd.
ifconfig: SIOCS80211: Device busy
wpa_supplicant already running?  (pid=323).

7 years agoMFC r309836: Add some tests for reaper functionality (in procctl()).
jilles [Sun, 18 Dec 2016 15:10:08 +0000 (15:10 +0000)]
MFC r309836: Add some tests for reaper functionality (in procctl()).

7 years agoMFC r310013 (by cperciva):
dim [Sun, 18 Dec 2016 14:31:11 +0000 (14:31 +0000)]
MFC r310013 (by cperciva):

Check that blkfront devices have a non-zero number of sectors and a
non-zero sector size.  Such a device would be a virtual disk of zero
bytes; clearly not useful, and not something we should try to attach.

As a fortuitous side effect, checking that these values are non-zero
here results in them not *becoming* zero later on the function.  This
odd behaviour began with r309124 (clang 3.9.0) but is challenging to
debug; making any changes to this function whatsoever seems to affect
the llvm optimizer behaviour enough to make the unexpected zeroing of
the sector_size variable cease.

PR: 215209
Security: The potential for variables to unexpectedly become zero
has worrying consequences for security in general, but
not so much in this particular context.

MFC r310086:

In xbd_connect(), use correct scanf conversion specifiers for the
feature_barrier and feature_flush variables.  Otherwise, adjacent
variables on the stack, such as sector_size, may be overwritten, with
disastrous results.

Note that I did not see a good reason to revert the addition of zero
checks introduced in r310013.  Better safe than sorry.

PR: 215209
Tested by: royger

7 years agoMFC r309851:
tuexen [Sun, 18 Dec 2016 13:48:28 +0000 (13:48 +0000)]
MFC r309851:

Ensure that the reported ppid and tsn are taken from the first fragment.

This fixes a bug where the wrong ppid was reported, if
* I-DATA was used on the first fragement was not received first
* DATA was used and different ppids where used.

Thanks to Julian Cordes for making me aware of the issue.

7 years agoMFC r309744:
tuexen [Sun, 18 Dec 2016 13:45:04 +0000 (13:45 +0000)]
MFC r309744:

Don't bundle a SACK chunk with a SHUTDOWN chunk if it is not required.

7 years agoMFC r309743:
tuexen [Sun, 18 Dec 2016 13:13:09 +0000 (13:13 +0000)]
MFC r309743:

Don't send multiple SHUTDOWN chunks in a single packet.

Thanks to Felix Weinrank for making me aware of this issue.

7 years agoMFC r309685:
tuexen [Sun, 18 Dec 2016 13:10:07 +0000 (13:10 +0000)]
MFC r309685:

Silence a warning produced by newer versions of gcc.

7 years agoMFC r309683:
tuexen [Sun, 18 Dec 2016 13:05:42 +0000 (13:05 +0000)]
MFC r309683:
Fix a bug in sctp_sendmsgx(), where the sid provided by the user
was hot honored.

7 years agoMFC r309682:
tuexen [Sun, 18 Dec 2016 13:04:29 +0000 (13:04 +0000)]
MFC r309682:

Cleanup the names of SSN, SID, TSN, FSN, PPID and MID.

This made a couple of bugs visible in handling SSN wrap-arounds
when using DATA chunks. Now bulk transfer seems to work fine...
This fixes the issue reported in
https://github.com/sctplab/usrsctp/issues/111

7 years agoMFC r309607:
tuexen [Sun, 18 Dec 2016 13:00:11 +0000 (13:00 +0000)]
MFC r309607:

Whitespace changes.

The tools using to generate the sources has been updated and produces
different whitespaces. Commit this seperately to avoid intermixing
these with real code changes.

7 years agoMFC r307779:
tuexen [Sun, 18 Dec 2016 12:56:14 +0000 (12:56 +0000)]
MFC r307779:

No functional changes, mostly getting the whitespace changes resulting
from an updated formatting tool chain.

7 years agoMFC r307217:
tuexen [Sun, 18 Dec 2016 12:52:52 +0000 (12:52 +0000)]
MFC r307217:

Mark the socket as un-writable when it is 1-to-1 and the SCTP association
is freed.

7 years agoMFC r307216:
tuexen [Sun, 18 Dec 2016 12:49:24 +0000 (12:49 +0000)]
MFC r307216:

Whitespace changes.

7 years agoMFC r306082:
tuexen [Sun, 18 Dec 2016 12:45:37 +0000 (12:45 +0000)]
MFC r306082:

Fix the handling of unordered fragmented user messages using DATA chunks.

There were two bugs:
* There was an accounting bug resulting in reporting a too small a_rwnd.
* There are a bug when abandoning messages in the reassembly queue.

7 years agoMFC r309397:
tuexen [Sun, 18 Dec 2016 12:27:35 +0000 (12:27 +0000)]
MFC r309397:

Fix the handling of  TCP FIN-segments in the CLOSED state

When a TCP segment with the FIN bit set was received in the CLOSED state,
a TCP RST-ACK-segment is sent. When computing SEG.ACK for this, the
FIN counts as one byte. This accounting was missing and is fixed by this
patch.

Sponsored by: Netflix, Inc.

7 years agoMFC r308832:
tuexen [Sun, 18 Dec 2016 12:23:48 +0000 (12:23 +0000)]
MFC r308832:

Ensure that TCP state changes to state-closing are reported via dtrace.
This does not cover state changes from TIME-WAIT.

Sponsored by: Netflix, Inc.

7 years agoMFC r308745:
tuexen [Sun, 18 Dec 2016 12:20:22 +0000 (12:20 +0000)]
MFC r308745:

Notify the user via setting errno when a TCP RST segment is received
either in the CLOSING or LAST-ACK state.

Sponsored by: Netflix, Inc.

7 years agoMFC r308616:
tuexen [Sun, 18 Dec 2016 12:16:47 +0000 (12:16 +0000)]
MFC r308616:

Fix typo.

Sponsored by: Netflix, Inc.

7 years agoMFC r307727, r307746:
tuexen [Sun, 18 Dec 2016 12:15:10 +0000 (12:15 +0000)]
MFC r307727, r307746:

Document the TCP sysctl variables insecure_rst and insecure_syn.

Sponsored by: Netflix, Inc.

7 years agoMFC r307726:
tuexen [Sun, 18 Dec 2016 12:12:49 +0000 (12:12 +0000)]
MFC r307726:

Make ICMPv6 hard error handling for TCP consistent with the ICMPv4
handling. Ensure that:
* Protocol unreachable errors are handled by indicating ECONNREFUSED
  to the TCP user for both IPv4 and IPv6. These were ignored for IPv6.
* Communication prohibited errors are handled by indicating ECONNREFUSED
  to the TCP user for both IPv4 and IPv6. These were ignored for IPv6.
* Hop Limited exceeded errors are handled by indicating EHOSTUNREACH
  to the TCP user for both IPv4 and IPv6.
  For IPv6 the TCP connected was dropped but errno wasn't set.

Sponsored by: Netflix, Inc.

7 years agoMFC r305810:
tuexen [Sun, 18 Dec 2016 11:54:10 +0000 (11:54 +0000)]
MFC r305810:

Ensure that the IPPROTO_TCP level socket options
* TCP_KEEPINIT
* TCP_KEEPINTVL
* TCP_KEEPIDLE
* TCP_KEEPCNT
always always report the values currently used when getsockopt()
is used. This wasn't the case when the sysctl-inherited default
values where used.
Ensure that the IPPROTO_TCP level socket option TCP_INFO has the
TCPI_OPT_ECN flag set in the tcpi_options field when ECN support
has been negotiated successfully.

Sponsored by: Netflix, Inc.

7 years agoMFC r309854:
kib [Sun, 18 Dec 2016 00:39:04 +0000 (00:39 +0000)]
MFC r309854:
Prefix hex memory addresses with 0x in diagnostic messages from the
SRAT parser.

7 years agoMFC r309774,r309778,r309779,r309780:
ngie [Sat, 17 Dec 2016 03:47:09 +0000 (03:47 +0000)]
MFC r309774,r309778,r309779,r309780:

r309774:

Only run mdconfig -d -u 3 if /dev/md3 exists on the system

This will prevent "cleanup failures" (exit code != 0 returned) when
tmpfs is not loaded

r309778:

Make test_unmount usable in cleanup subroutines

- Duplicate test_unmount to _test_unmount
- Remove atf_check calls
- Call _test_unmount from test_unmount, checking the exit code
  at the end, and returning it to maintain the test_unmount
  "contract"

r309779:

- Ignore errors from umount
- Use _test_unmount instead of test_unmount in cleanup

r309780:

Use _test_unmount instead of test_unmount in cleanup to avoid
false positives with atf_check when tmpfs is not loaded, etc

7 years agoMFC r308806
asomers [Fri, 16 Dec 2016 20:49:50 +0000 (20:49 +0000)]
MFC r308806

Speed up pw operations that edit /etc/group or /etc/passwd

r285050 fixed a bug in pw that could lead to /etc/passwd or /etc/group
corruption on power loss. However, it fixed it by opening those files with
O_SYNC, which is very slow, especially on ZFS. This change replaces O_SYNC with
appropriately placed fsync()s instead, which is much faster. Using a ZFS
tmpdir, the time to run pw's kyua tests drops from 245s to 35s.

7 years agoMFC r309374, r309513, r309839, r309840:
ken [Fri, 16 Dec 2016 20:24:47 +0000 (20:24 +0000)]
MFC r309374, r309513, r309839, r309840:

  ------------------------------------------------------------------------
  r309374 | ken | 2016-12-01 15:20:27 -0700 (Thu, 01 Dec 2016) | 41 lines

  Add SCSI REPORT TIMESTAMP and SET TIMESTAMP support.

  This adds support to camcontrol(8) and libcam(3) for getting and setting
  the time on SCSI protocol drives.  This is more commonly found on tape
  drives, but is a SPC (SCSI Primary Commands) command, and may be found
  on any device that speaks SCSI.

  The new camcontrol timestamp subcommand allows getting the current device
  time or setting the time to the current system time or any arbitrary time.

  sbin/camcontrol/Makefile:
   Add timestamp.c.

  sbin/camcontrol/camcontrol.8:
   Document the new timestamp subcommand.

  sbin/camcontrol/camcontrol.c:
   Add the timestamp subcommand to camcontrol.

  sbin/camcontrol/camcontrol.h:
   Add the timestamp() function prototype.

  sbin/camcontrol/timestamp.c:
   Timestamp setting and reporting functionality.

  sys/cam/scsi/scsi_all.c:
   Add two new CCB building functions, scsi_set_timestamp() and
   scsi_report_timestamp().  Also, add a new helper function,
   scsi_create_timestamp().

  sys/cam/scsi/scsi_all.h:
   Add CDB and parameter data for the the set and report timestamp
   commands.

   Add function declarations for the new CCB building and helper
   functions.

  Submitted by: Sam Klopsch
  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------
  r309513 | adrian | 2016-12-03 13:35:39 -0700 (Sat, 03 Dec 2016) | 7 lines

  [camcontrol] init ts=0 to quieten gcc.

  It "looks" like ts is set to something on success, and not modified on
  error.

  Checked on IRC with: cem

  ------------------------------------------------------------------------
  r309839 | ngie | 2016-12-10 16:26:34 -0700 (Sat, 10 Dec 2016) | 6 lines

  free/NULL out variables prior to calling strdup to avoid leaking memory
  if arguments are specified more than once with "camcontrol timestamp".

  CID: 13668291366831

  ------------------------------------------------------------------------
  r309840 | ngie | 2016-12-10 16:58:14 -0700 (Sat, 10 Dec 2016) | 8 lines

  Cut to the chase and just call free instead of free(x) + x = NULL

  NULLing out x wasn't required as the memory was immediately scribbled
  over with strdup in the following call.

  Submitted by: imp

  ------------------------------------------------------------------------

7 years agoMFC r309935:
manu [Fri, 16 Dec 2016 15:45:09 +0000 (15:45 +0000)]
MFC r309935:

Use the spibus accessor when applicable.

7 years agoMFC r309063:
manu [Fri, 16 Dec 2016 15:37:18 +0000 (15:37 +0000)]
MFC r309063:

Test that the emac device is enabled in probe function

7 years agoMFC r309912:
manu [Fri, 16 Dec 2016 15:33:21 +0000 (15:33 +0000)]
MFC r309912:

CS ivar is uint32_t, not int.

7 years agoMFC 309274:
jhb [Fri, 16 Dec 2016 01:14:00 +0000 (01:14 +0000)]
MFC 309274:
Use the correct name for the GCC macro indicating max_align_t is defined.

7 years agoMFC 308690: Sync instruction cache's after writing user breakpoints on MIPS.
jhb [Fri, 16 Dec 2016 01:06:35 +0000 (01:06 +0000)]
MFC 308690: Sync instruction cache's after writing user breakpoints on MIPS.

Add an implementation for pmaps_sync_icache() on MIPS that sync's the
instruction cache on all CPUs via smp_rendezvous() after a debugger
inserts a breakpoint via ptrace(PT_IO).

7 years agoMFC 308565: Allow scheduling during early boot.
jhb [Thu, 15 Dec 2016 22:39:52 +0000 (22:39 +0000)]
MFC 308565: Allow scheduling during early boot.

- Send IPI wakeups once SMP is started even if cold is true.
- Permit preemptions when cold is true.

These changes are needed for EARLY_AP_STARTUP.

7 years agoMFC r309602:
ngie [Thu, 15 Dec 2016 20:10:20 +0000 (20:10 +0000)]
MFC r309602:

Remove svn[lite]{bench,fsfs} if either MK_SVN == no or MK_SVNLITE == no

7 years agoMFC r309676
vangyzen [Thu, 15 Dec 2016 16:51:33 +0000 (16:51 +0000)]
MFC r309676

Export the whole thread name in kinfo_proc

kinfo_proc::ki_tdname is three characters shorter than
thread::td_name.  Add a ki_moretdname field for these three
extra characters.  Add the new field to kinfo_proc32, as well.
Update all in-tree consumers to read the new field and assemble
the full name, except for lldb's HostThreadFreeBSD.cpp, which
I will handle separately.  Bump __FreeBSD_version.

Sponsored by: Dell EMC

7 years agoMFC r309709:
kib [Thu, 15 Dec 2016 10:44:45 +0000 (10:44 +0000)]
MFC r309709:
Move map_generation snapshot value into struct faultstate.

7 years agoMFC r309708:
kib [Thu, 15 Dec 2016 10:42:14 +0000 (10:42 +0000)]
MFC r309708:
Style.

7 years agoMFC 309714: Fix spa_alloc_tree sorting by offset in r305331.
mav [Thu, 15 Dec 2016 08:10:47 +0000 (08:10 +0000)]
MFC 309714: Fix spa_alloc_tree sorting by offset in r305331.

Original commit "7090 zfs should improve allocation order" declares alloc
queue sorted by time and offset.  But in practice io_offset is always zero,
so sorting happened only by time, while order of writes with equal time was
completely random.  On Illumos this did not affected much thanks to using
high resolution timestamps.  On FreeBSD due to using much faster but low
resolution timestamps it caused bad data placement on disks, affecting
further read performance.

This change switches zio_timestamp_compare() from comparing uninitialized
io_offset to really populated io_bookmark values.  I haven't decided yet
what to do with timestampts, but on simple tests this change gives the
same peformance results by just making code to work as declared.

7 years agoMFC r309563: pflog: Correctly initialise subrulenr
kp [Wed, 14 Dec 2016 21:29:12 +0000 (21:29 +0000)]
MFC r309563: pflog: Correctly initialise subrulenr

subrulenr is considered unset if it's set to -1, not if it's set to 1.
See contrib/tcpdump/print-pflog.c pflog_print() for a user.

This caused incorrect pflog output (tcpdump -n -e -ttt -i pflog0):
  rule 0..16777216(match)
instead of the correct output of
  rule 0/0(match)

PR: 214832
Submitted by: andywhite@gmail.com

7 years agoMFC r309119: virtio_pci: fix announcement of MSI-X interrupts for queues
avg [Wed, 14 Dec 2016 16:44:33 +0000 (16:44 +0000)]
MFC r309119: virtio_pci: fix announcement of MSI-X interrupts for queues

7 years agoMFC r309093: firewire: initialize tag label to -1 in fw_xfer_alloc()
avg [Wed, 14 Dec 2016 16:43:04 +0000 (16:43 +0000)]
MFC r309093: firewire: initialize tag label to -1 in fw_xfer_alloc()

7 years agoMFC r308529: intpm: clean up intsmb_bread and intsmb_pcall
avg [Wed, 14 Dec 2016 16:34:13 +0000 (16:34 +0000)]
MFC r308529: intpm: clean up intsmb_bread and intsmb_pcall

7 years agoMFC r309092: fwohci: report whether PhysicalUpperBound register is implemented
avg [Wed, 14 Dec 2016 16:30:47 +0000 (16:30 +0000)]
MFC r309092: fwohci: report whether PhysicalUpperBound register is implemented

7 years agoMFC r308104: add iic interface to ig4 driver, move isl and cyapa to iicbus
avg [Wed, 14 Dec 2016 16:27:28 +0000 (16:27 +0000)]
MFC r308104: add iic interface to ig4 driver, move isl and cyapa to iicbus

7 years agoMFC r306589: Implement iicbus_write_ivar and impelemnt the NOSTOP ivar
avg [Wed, 14 Dec 2016 16:20:51 +0000 (16:20 +0000)]
MFC r306589: Implement iicbus_write_ivar and impelemnt the NOSTOP ivar
in both read and write.

7 years agoMFC r308985: revert r304520, set canmount=on is not supposed to mount
avg [Wed, 14 Dec 2016 16:10:58 +0000 (16:10 +0000)]
MFC r308985: revert r304520, set canmount=on is not supposed to mount
the filesystem

7 years agoMFC r308887,309090: fix unsafe modification of zfs_vnodeops when
avg [Wed, 14 Dec 2016 16:08:28 +0000 (16:08 +0000)]
MFC r308887,309090: fix unsafe modification of zfs_vnodeops when
DIAGNOSTIC is enabled

7 years agoMFC r308527: smb: fix SMB_READB, SMB_READW, SMB_PCALL to work as documented
avg [Wed, 14 Dec 2016 16:05:48 +0000 (16:05 +0000)]
MFC r308527: smb: fix SMB_READB, SMB_READW, SMB_PCALL to work as documented

7 years agoMFC r308480: pmc_process_csw_out: ignore deleted counters
avg [Wed, 14 Dec 2016 16:04:04 +0000 (16:04 +0000)]
MFC r308480: pmc_process_csw_out: ignore deleted counters

7 years agoMFH (r308996, r309051, r309738): refactor, avoid repeating DNS requests
des [Wed, 14 Dec 2016 14:20:32 +0000 (14:20 +0000)]
MFH (r308996, r309051, r309738): refactor, avoid repeating DNS requests

7 years agoMFC r309460
vangyzen [Tue, 13 Dec 2016 23:34:07 +0000 (23:34 +0000)]
MFC r309460

thr_set_name(): silently truncate the given name as needed

Instead of failing with ENAMETOOLONG, which is swallowed by
pthread_set_name_np() anyway, truncate the given name to MAXCOMLEN+1
bytes.  This is more likely what the user wants, and saves the
caller from truncating it before the call (which was the only
recourse).

Polish pthread_set_name_np(3) and add a .Xr to thr_set_name(2)
so the user might find the documentation for this behavior.

Sponsored by: Dell EMC

7 years agoMFC r309625
vangyzen [Tue, 13 Dec 2016 23:12:59 +0000 (23:12 +0000)]
MFC r309625

This is imported from NetBSD.  The author--Joerg Sonnenberger--agreed
to apply a two-clause BSD license, just so the license was clear.

This source tree location matches NetBSD, and is the first place someone
might look for such a tool.

Obtained from: Joerg Sonnenberger via NetBSD
Sponsored by: Dell EMC

7 years agoMFC r309364 r309367 r309624
vangyzen [Tue, 13 Dec 2016 23:09:22 +0000 (23:09 +0000)]
MFC r309364 r309367 r309624

locale: fix buffer management

Also, handle signed and unsigned chars, and more gracefully handle
invalid input.

locale: enable more warnings; fix them

Do not set WARNS, so it gets the current default of 6.
Fix the warnings by sprinkling static, const, or strdup.
Make some constant data tables const.  Fix whitespace.

Sponsored by: Dell EMC

7 years agoMFC r309630:
kib [Tue, 13 Dec 2016 09:43:49 +0000 (09:43 +0000)]
MFC r309630:
Do not leak curthread->inact_mtx when cancelling in pthread_cond_wait(3).

7 years agoMFC r309660:
ae [Tue, 13 Dec 2016 09:17:30 +0000 (09:17 +0000)]
MFC r309660:
  Convert result of hash_packet6() into host byte order.

  For IPv4 similar function uses addresses and ports in host byte order,
  but for IPv6 it used network byte order. This led to very bad hash
  distribution for IPv6 flows. Now the result looks similar to IPv4.

7 years agoMFC r308615 [brd]:
dteske [Tue, 13 Dec 2016 04:53:25 +0000 (04:53 +0000)]
MFC r308615 [brd]:
Attempt to make the parts that people are supposed to change stand out more
by capitalizing them.

Approved by: me

7 years agoMFC r309504: Fix bug preventing limits(1) from being applied
dteske [Tue, 13 Dec 2016 04:50:45 +0000 (04:50 +0000)]
MFC r309504: Fix bug preventing limits(1) from being applied

PR: misc/212493
Differential Revision: https://reviews.freebsd.org/D8232
Submitted by: girgen
Reviewed by: adrian

7 years agoMFC r307159: Add jail_confwarn="NO" (default YES)
dteske [Tue, 13 Dec 2016 04:47:21 +0000 (04:47 +0000)]
MFC r307159: Add jail_confwarn="NO" (default YES)

Differential Revision: https://reviews.freebsd.org/D7465
Reviewed by: jelischer
Sponsored by: FIS Global, Inc.

7 years agoMFC r306012 [trasz]:
dteske [Tue, 13 Dec 2016 04:45:21 +0000 (04:45 +0000)]
MFC r306012 [trasz]:
Fix -media to not mount ufs with "async"; it doesn't make sense when
there is softupdates.

7 years agoMFC r306011 [trasz]:
dteske [Tue, 13 Dec 2016 04:44:06 +0000 (04:44 +0000)]
MFC r306011 [trasz]:
Stop appending "noatime" in the autofs -media map, and instead add it
to auto_master, since all filesystems seem to support it.  It's cleaner
this way, and easier to customize.

7 years agoMFC r306009 [trasz]:
dteske [Tue, 13 Dec 2016 04:43:03 +0000 (04:43 +0000)]
MFC r306009 [trasz]:
Make autofs(5) -media map also use "async" and "noatime" for ext2fs(5).

7 years agoMFC r305969 [trasz]:
dteske [Tue, 13 Dec 2016 04:41:49 +0000 (04:41 +0000)]
MFC r305969 [trasz]:
Make autofs use the "noatime" flag for msdosfs, ntfs, and ufs
filesystems mounted on /media.

7 years agoMFC r305968 [trasz]:
dteske [Tue, 13 Dec 2016 04:39:44 +0000 (04:39 +0000)]
MFC r305968 [trasz]:
Make autofs use the "async" flag for msdosfs and ufs filesystems mounted
on /media.

7 years agoMFC r303943: Allow enforce_statfs (see jail(8)) to be set per jail
dteske [Tue, 13 Dec 2016 04:37:14 +0000 (04:37 +0000)]
MFC r303943: Allow enforce_statfs (see jail(8)) to be set per jail

Reviewed by: jelischer

7 years agoMFC r302798 [cy]: Restore lost comment from r301295.
dteske [Tue, 13 Dec 2016 04:35:19 +0000 (04:35 +0000)]
MFC r302798 [cy]: Restore lost comment from r301295.

PR: 211027
Reported by: Trond.Endrestol@ximalas.info

7 years agoRegen after r309954
bapt [Mon, 12 Dec 2016 21:49:29 +0000 (21:49 +0000)]
Regen after r309954

7 years agoMFC r309805:
bapt [Mon, 12 Dec 2016 21:45:25 +0000 (21:45 +0000)]
MFC r309805:

Make WITHOUT_CAPSICUM implying WITHOUT_CASPER

PR: 214562
Reported by: dewayne@heuristicsystems.com.au

7 years agoMFC r309797-r309802
bapt [Mon, 12 Dec 2016 21:43:17 +0000 (21:43 +0000)]
MFC r309797-r309802

r309797:
Add entries to remove timed files with make delete-old if WITHOUT_TIMED is set

r309798:
Also remove auditdistd files if src.conf has WITHOUT_AUDIT

r309799:
Respect WITHOUT_RBOOTD in src.conf when running make delete-old

r309800:
Respect WITHOUT_BOOTPARAMD in src.conf when running make delete-old

r309801:
Respect WITHOUT_BOOTPD in src.conf when running make delete-old

r309802:
Respect WITHOUT_FINGER in src.conf when running make delete-old

PR: 213719, 213720, 213721, 213722, 213723, 213724
Submitted by: philippe.michel7@sfr.fr

7 years agoMFC r307684, r307747
ken [Mon, 12 Dec 2016 21:02:34 +0000 (21:02 +0000)]
MFC r307684, r307747
  ------------------------------------------------------------------------
  r307684 | ken | 2016-10-20 13:42:26 -0600 (Thu, 20 Oct 2016) | 13 lines

  For CCBs allocated on the stack, we need to clear the entire CCB, not just
  the header.  Otherwise stack garbage can lead to random flags getting set.

  This showed up as 'camcontrol rescan all' failing with EINVAL because the
  address type wasn't CAM_DATA_VADDR.

  sbin/camcontrol/camcontrol.c:
   In rescan_or_reset_bus(), bzero the stack-allocated CCBs before
   use instead of clearing the body.

  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------
  r307747 | ken | 2016-10-21 12:54:56 -0600 (Fri, 21 Oct 2016) | 27 lines

  Fix a problem in camcontrol(8) that cropped up with r307684.

  In r307684, I changed rescan_or_reset_bus() to bzero stack-allocated CCBs
  before sending them to the kernel because there was stack garbage in there
  that wound up meaning that bogus CCB flags were set.

  While this fixed the 'camcontrol rescan all' case (XPT_DEV_MATCH CCBs were
  failing previously), it broke the 'camcontrol rescan 0' (or any other
  number) case when INVARIANTS are turned on.  Rescanning a single bus
  reliably produced an assert in cam_periph_runccb():

  panic: cam_periph_runccb: ccb=0xfffff80044ffe000, func_code=0x708, flags=0xffffdde0

  The flags values don't make sense from the code.  Changing the CCBs in
  rescan_or_reset_bus() from stack to heap allocated avoids the problem.

  It would be better to understand why userland stack allocated CCBs don't
  work properly, since there may be other code that breaks if stack allocated
  CCBs don't work.

  sbin/camcontrol/camcontrol.c:
   In rescan_or_reset_bus(), allocate the CCBs using malloc(3) instead
   of on the stack to avoid an assertion in cam_periph_runccb().

  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------

Sponsored by: Spectra Logic

7 years agoMFC r307402: Guard against bad service name argument(s) to load_rc_config()
dteske [Mon, 12 Dec 2016 17:56:56 +0000 (17:56 +0000)]
MFC r307402: Guard against bad service name argument(s) to load_rc_config()

7 years agoMFC: r309060
brueffer [Mon, 12 Dec 2016 11:02:55 +0000 (11:02 +0000)]
MFC: r309060

Fix comment typo.

PR: 208484
Submitted by: madpilot

7 years agoMFC r309550:
kib [Mon, 12 Dec 2016 09:43:48 +0000 (09:43 +0000)]
MFC r309550:
Rename fast taskqueues used by DMAR.