]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
6 years agoMFC r317848:
ken [Mon, 8 May 2017 17:55:51 +0000 (17:55 +0000)]
MFC r317848:

  Add basic programmable early warning error injection to the sa(4) driver.

  This will help application developers simulate end of tape conditions.

  To inject an error in sa0:

  sysctl kern.cam.sa.0.inject_eom=1

  This will return the next read or write request queued with 0 bytes
  written.  Any subsequent writes or reads will go along as usual.

  This will also cause the early warning position flag to get set
  for the next position query.  So, 'mt status' will show the BPEW
  (Beyond Programmable Early Warning) flag on the first query after
  an error injection.  After that, the position flags will be as they
  are in the underlying tape drive.

  Also, update the sa(4) man page to describe tape parameters,
  which can be set via 'mt param'.

  sys/cam/scsi/scsi_sa.c:
   In saregister(), create the inject_eom sysctl variable.

   In sastart(), check to see whether inject_eom is set.  If
   so, return the read or write with 0 bytes written to
   indicate EOM.  Set the set_pews_status flag so that we
   fake PEWS status in the next position call for reads, and the
   next 3 calls for writes.  This allows the user to see the BPEW
   flag one time via 'mt status'.

   In sagetpos(), check the set_pews_status flag and fake
   PEWS status and decrement the counter if it is set.

  share/man/man4/sa.4:
   Document the inject_eom sysctl variable.

   Document all of the parameters currently supported via
   'mt param'.

  usr.bin/mt/mt.1:
   Point the user to the sa(4) man page for more details on
   supported parameters.

Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/10@317964 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r317799:
ken [Mon, 8 May 2017 17:21:57 +0000 (17:21 +0000)]
MFC r317799:

  Add the SCSI Solid State Media Log page (0x11) definition.

  sys/cam/scsi/scsi_all.h:
   Add the SCSI Solid State Media log page (0x11) structure
   definition.  This gives the percentage used (in terms of
   lifetime flash wear) of an SSD.

Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/10@317962 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r317774, r317776
ken [Mon, 8 May 2017 17:02:03 +0000 (17:02 +0000)]
MFC r317774, r317776

r317774:
  Add the ability to rescan or reset devices specified by peripheral
  name and unit number in camcontrol(8).

  Previously camcontrol(8) only supported rescanning or resetting
  devices specified by bus:target:lun.  This is because for
  rescanning at least, you don't have a peripheral name and unit
  number (e.g. da4) for devices that don't exist yet.

  That is still the case after this change, but in other cases, when
  the device does exist in the CAM EDT (Existing Device Table), we
  do a careful lookup of the bus/target/lun if the user supplies a
  peripheral name and unit number to find the bus:target:lun and then
  issue the requested reset or rescan.

  The lookup is done without actually opening the device in question,
  since a rescan is often done to make a device go away after it has
  been pulled.  (This is especially true for busses/controllers, like
  parallel SCSI controllers, that don't automatically detect changes
  in topology.)  Opening a device that is no longer there to
  determine the bus/target/lun might result in error recovery actions
  when the user really just wanted to make the device go away.

  sbin/camcontrol/camcontrol.c:
   In dorescan_or_reset(), if the use hasn't specified a
   numeric argument, assume he has specified a device.  Lookup
   the pass(4) instance for that device using the transport
   layer CAMGETPASSTHRU ioctl.  If that is successful, we can
   use the returned bus:target:lun to rescan or reset the
   device.

   Under the hood, resetting a device using XPT_RESET_DEV is
   actually sent via the pass(4) device anyway.  But this
   provides a way for the user to specify devices in a more
   convenient way, and can work on device rescans when the
   device is going away, assuming it still exists in the EDT.

  sbin/camcontrol/camcontrol.8:
   Update the man page for the rescan and reset subcommands
   to reflect that you can now use a device name and unit
   number with them.

Sponsored by: Spectra Logic

r317776:
  Bump the camcontrol(8) man page date.

Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/10@317947 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r317745:
ken [Mon, 8 May 2017 14:48:39 +0000 (14:48 +0000)]
MFC r317745:

  Don't bother retrying errors for encrypted drives that are locked.

  sys/cam/scsi/scsi_all.c:
   In the asc_table, if we get a 0x20,0x02 error ("Access denied -
   no access rights"), don't bother retrying.  Instead, immediately
   fail the command.

   This is the error returned by Self Encrypting Drives (SED) when
   they are locked.

Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/10@317941 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC: r317276
rmacklem [Sun, 7 May 2017 22:18:05 +0000 (22:18 +0000)]
MFC: r317276
Don't set ND_NOMOREDATA for a failed Setattr operation (NFSv4).

The NFSv4 Setattr operation always has reply data even when it fails,
so don't set the ND_NOMOREDATA for it. This would only affect unusual
cases where Setattr fails and the RPC code wants to parse the rest of
the compound. Detected during recent development related to the pNFS server.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317930 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC: r317275, r317344
rmacklem [Sun, 7 May 2017 21:57:46 +0000 (21:57 +0000)]
MFC: r317275, r317344
Don't create a backchannel for a DS connection.

An NFSv4.1 client connection to a Data Server (DS) should not have a
backchannel. This patch fixes the NFSv4.1/pNFS client to not do a backchannel
for this case.
Found during recent testing with the pNFS server under development.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317927 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC: r317272
rmacklem [Sun, 7 May 2017 21:32:55 +0000 (21:32 +0000)]
MFC: r317272
Add checks for failed operations to the NFSv4 client function nfscl_mtofh().

The nfscl_mtofh() function didn't check for failed operations and, as such,
would have returned EBADRPC for these cases, due to parsing failure.
This patch adds checks, so that it returns with ND_NOMOREDATA set.
This is needed for future use in the pNFS server and acts as a safety
belt in the meantime.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317925 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC: r317270
rmacklem [Sun, 7 May 2017 21:06:23 +0000 (21:06 +0000)]
MFC: r317270
Get rid of bogus statement in the nfsuserd.8 man page.

The nfsuserd.8 man page stated that a usertimeout of 0 would disable
the cache timeout. This was simply not true, so this patch deletes
the sentence.

This is a content change.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317922 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC: r317350
rmacklem [Sun, 7 May 2017 20:50:32 +0000 (20:50 +0000)]
MFC: r317350
Fix the default uid/gid values in nfsuserd.c

This patch sets the default uid/gid values for "nobody" and "nogroup"
to the values in the password and group databases. Normally nfsuserd(8)
will override these with whatever is in the password/group databases,
so these values are only used when the databases entries aren't available.
It would be nice to use the definitions in sys/conf.h, but those are
in the _KERNEL section of the file.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317920 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC: r317269
rmacklem [Sun, 7 May 2017 20:21:59 +0000 (20:21 +0000)]
MFC: r317269
Set default uid/gid to nobody/nogroup for NFSv4 mapping.

The default uid/gid for NFSv4 are set by the nfsuserd(8) daemon.
However, they were 0 until the nfsuserd(8) was run. Since it is
possible to use NFSv4 without running the nfsuserd(8) daemon, set them
to nobody/nogroup initially.
Without this patch, the values would be set by the nfsuserd(8) daemon
and left changed even if the nfsuserd(8) daemon was killed. The default
values of 0 meant that setting a group to "wheel" would fail even when
done by root.
It also adds a definition of GID_NOGROUP to sys/conf.h.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317917 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC: r317236
rmacklem [Sun, 7 May 2017 19:57:45 +0000 (19:57 +0000)]
MFC: r317236
Fix the setting of atime for Linux client NFSv4 mounts.

The FreeBSD NFSv4 server did not set the attribute bit for TimeAccess in
the reply to an Open with exclusive_create, as required by the RFCs.
(This is required since the FreeBSD NFS server stores the create_verifier
 in the va_atime attribute.)
As such, the Linux NFSv4 client did not set the TimeAccess (atime) in
the Setattr done in an RPC after the one with the Open/exclusive_create.
This patch fixes the server to set the TimeAccess bit in the reply.

I believe that storing the create_verifier in an extended attribute for
file systems that support extended attributes might be a good idea,
but I will wait for a discussion of this on the freebsd-fs@ email list
before considering committing a patch to do this.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317914 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC: r317591
nyan [Sun, 7 May 2017 11:11:51 +0000 (11:11 +0000)]
MFC: r317591

  Add TUNABLE_INT to radeonkms driver parameters.
  They are required by PowerMac G5 DP.

  PR:           217852
  Submitted by: Hiroo Ono

git-svn-id: svn://svn.freebsd.org/base/stable/10@317903 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r317611:
kib [Sun, 7 May 2017 08:02:28 +0000 (08:02 +0000)]
MFC r317611:
Make semaphore names list mutex non-recursive.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317900 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r317610:
kib [Sun, 7 May 2017 08:01:29 +0000 (08:01 +0000)]
MFC r317610:
Restructure normal (non-error) control flow in sem_close().

git-svn-id: svn://svn.freebsd.org/base/stable/10@317899 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r317606:
kib [Sun, 7 May 2017 08:00:34 +0000 (08:00 +0000)]
MFC r317606:
Style.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317898 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r317680:
ken [Fri, 5 May 2017 20:25:31 +0000 (20:25 +0000)]
MFC r317680:

  Add the SCSI SSC Manufacturer assigned serial number VPD page.

  This is current as of SSC-5r03.

Submitted by: Sam Klopsch
Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/10@317851 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r317388:
brooks [Fri, 5 May 2017 17:28:49 +0000 (17:28 +0000)]
MFC r317388:

Use the approved syntax to build no man pages.

Sponsored by: DARPA, AFRL

git-svn-id: svn://svn.freebsd.org/base/stable/10@317841 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r317566:
brooks [Fri, 5 May 2017 16:24:35 +0000 (16:24 +0000)]
MFC r317566:

Don't pass size_t arguments to setsockopt(SO_SNDBUF/SO_RCVBUF).

These commands take an int. The tests work by accident on little-endian,
64-bit systems.

PR: 218919
Tested with: qemu-cheri and CheriBSD built for mips64
Reviewed by: asomers, ngie
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL

git-svn-id: svn://svn.freebsd.org/base/stable/10@317834 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r317568:
hselasky [Fri, 5 May 2017 13:23:23 +0000 (13:23 +0000)]
MFC r317568:

Improve sysadmin visibility of physical port error counters in the
mlx5en driver.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@317826 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC 317821
sephe [Fri, 5 May 2017 06:00:32 +0000 (06:00 +0000)]
MFC 317821
    hyperv/kbd: Channel read expects non-NULL channel argument.

    Sponsored by: Microsoft

git-svn-id: svn://svn.freebsd.org/base/stable/10@317823 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r317596:
pfg [Thu, 4 May 2017 14:55:07 +0000 (14:55 +0000)]
MFC r317596:
mixer(8): Prevent possible sscanf() overflow.

Fix %s buffer sizes in sscanf().

Obtained from: DragonflyBSD (git dab952e2)

git-svn-id: svn://svn.freebsd.org/base/stable/10@317796 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r317583:
pfg [Thu, 4 May 2017 14:50:25 +0000 (14:50 +0000)]
MFC r317583:
Fix some cases where an index was used before its limits check.

Obtained from: DragonFlyBSD (git 799ba435)

git-svn-id: svn://svn.freebsd.org/base/stable/10@317794 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r317436:
kib [Wed, 3 May 2017 09:54:37 +0000 (09:54 +0000)]
MFC r317436:
getpagesize(3) cannot fail.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317735 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoixgbe(4): Fix build issue when compiling with netmap enabled
erj [Tue, 2 May 2017 22:57:27 +0000 (22:57 +0000)]
ixgbe(4): Fix build issue when compiling with netmap enabled

Sponsored by: Intel Corporation

git-svn-id: svn://svn.freebsd.org/base/stable/10@317711 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r317356: Switch isp_reset to scratchpad not requiring ISP_MBOXDMASETUP.
mav [Mon, 1 May 2017 06:05:04 +0000 (06:05 +0000)]
MFC r317356: Switch isp_reset to scratchpad not requiring ISP_MBOXDMASETUP.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317636 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r317064: Optimize pathologic case of telldir() for Samba.
mav [Mon, 1 May 2017 06:03:44 +0000 (06:03 +0000)]
MFC r317064: Optimize pathologic case of telldir() for Samba.

When application reads large directory, calling telldir() for each entry,
like Samba does, it creates exponential performance drop as number of
entries reach tenths to hundreds of thousands.  It is caused by full search
through the internal list, that never finds matches in that scenario, but
creates O(n^2) delays.  This patch optimizes that search, limiting it to
entries of the same buffer, turning time closer to O(n) in case of linear
directory scan.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317634 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r317214:
dim [Sat, 29 Apr 2017 23:26:36 +0000 (23:26 +0000)]
MFC r317214:

Turn off llvm/clang's ENABLE_BACKTRACES setting, since it never worked
properly anyway.  (Upstream has reorganized this somewhat in the mean
time, but for proper backtraces we would need llvm-symbolizer in base.)

MFC r317215:

Add function and data sections when building llvm, clang, lld and lldb,
and allow the linker to garbage collect them.  This shaves off up to a
few MB from the final executables.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317599 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r316829
rmacklem [Sat, 29 Apr 2017 01:04:39 +0000 (01:04 +0000)]
MFC: r316829
Remove unused "cred" argument to ncl_flush().

The "cred" argument of ncl_flush() is unused and it was confusing to have
the code passing in NULL for this argument in some cases. This patch deletes
this argument.
There is no semantic change because of this patch.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317579 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoRevert r314937 as anonymous unions in GCC don't seem to work.
pfg [Thu, 27 Apr 2017 23:14:01 +0000 (23:14 +0000)]
Revert r314937 as anonymous unions in GCC don't seem to work.

This has been breaking the powerpc(LINT64 at least) for quite a while now.

Reported by: emaste

git-svn-id: svn://svn.freebsd.org/base/stable/10@317532 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMove td_sigqueue to the end of struct thread
badger [Thu, 27 Apr 2017 22:28:49 +0000 (22:28 +0000)]
Move td_sigqueue to the end of struct thread

In order to preserve KBI in stable branches, replace the existing
td_sigqueue slot with padding and move the expanded (as of r315949)
td_sigqueue to the end of the struct.

Reported by: jhb
Suggested by: kib
Reviewed by: jhb, kib, vangyzen
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10515

git-svn-id: svn://svn.freebsd.org/base/stable/10@317529 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r316793
rmacklem [Thu, 27 Apr 2017 21:45:50 +0000 (21:45 +0000)]
MFC: r316793
Document the "oneopenown" option added by r316792.

This is a content change.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317526 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r316792
rmacklem [Thu, 27 Apr 2017 21:37:39 +0000 (21:37 +0000)]
MFC: r316792
Add an NFSv4.1 mount option for "use one openowner".

Some NFSv4.1 servers such as AmazonEFS can only support a small fixed number
of open_owner4s. This patch adds a mount option called "oneopenown" that
can be used for NFSv4.1 mounts to make the client do all Opens with the
same open_owner4 string. This option can only be used with NFSv4.1 and
may not work correctly when Delegations are is use.

Differential Revision: https://reviews.freebsd.org/D8988

git-svn-id: svn://svn.freebsd.org/base/stable/10@317525 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r316782
rmacklem [Thu, 27 Apr 2017 21:27:20 +0000 (21:27 +0000)]
MFC: r316782
Add call to svcpool_close() for the NFSv4 callback pool (svcpool_nfscbd).

A function called svcpool_close() was added to the server side krpc by
r313735, so that a pool could be closed without destroying the data structures.
This little patch adds a call to it for the callback pool (svcpool_nfscbd),
so that the nfscbd daemon can be killed/restarted and continue to work
correctly.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317524 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315237 (kib): Hide kev_iovlen() definition under #ifdef KTRACE
emaste [Thu, 27 Apr 2017 18:21:38 +0000 (18:21 +0000)]
MFC r315237 (kib): Hide kev_iovlen() definition under #ifdef KTRACE

Fixes build of kernel configs without KTRACE.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@317513 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r317196:
kib [Thu, 27 Apr 2017 12:15:15 +0000 (12:15 +0000)]
MFC r317196:
Write-combine framebuffer writes through user-space mappings, if possible.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317501 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316777 (by cem)
truckman [Thu, 27 Apr 2017 07:32:07 +0000 (07:32 +0000)]
MFC r316777 (by cem)

dummynet: Use strlcpy to appease static checkers

Some dummynet modules used strcpy() to copy from a larger buffer
(dn_aqm->name) to a smaller buffer (dn_extra_parms->name).  It happens that
the lengths of the strings in the dn_aqm buffers were always hardcoded to be
smaller than the dn_extra_parms buffer ("CODEL", "PIE").

Use strlcpy() instead, to appease static checkers.  No functional change.

Reported by: Coverity
CIDs: 13561631356165
Sponsored by: Dell EMC Isilon

git-svn-id: svn://svn.freebsd.org/base/stable/10@317489 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 317353
sephe [Thu, 27 Apr 2017 02:17:45 +0000 (02:17 +0000)]
MFC 317353

    hyperv/hn: Use channel0, i.e. TX ring0, for TCP SYN/SYN|ACK.

    Hyper-V hot channel effect:
    Operation latency on hot channel is only _half_ of the operation
    latency on cold channels.

    This commit takes the advantage of the above Hyper-V host channel
    effect, and can reduce more than 75% latency and more than 50%
    latency stdev, i.e. lower and more stable/predictable latency,
    for various types of web server workloads.

    Sponsored by:   Microsoft

git-svn-id: svn://svn.freebsd.org/base/stable/10@317482 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r316745
rmacklem [Wed, 26 Apr 2017 23:24:05 +0000 (23:24 +0000)]
MFC: r316745
Fix the NFS client for "text file modified, process killed" mmap'd case.

When an mmap'd text file is written and then executed immediately
afterwards, it was possible that the modify time would change after the
text file was executing, resulting in the process executing the file
being killed. This was usually only observed when the file system's
times were set to higher resolution, but could have occurred for any
time resolution.
This patch adds a VOP_SET_TEXT() to the NFS client which flushed all
dirty pages to the NFS server and then makes sure that n_mtime is up
to date to avoid this from occurring.
Thanks go to kib@ and pho@ for their help with developing this patch.

The call to ncl_flush() has been removed. If r316532 is merged into stable/10,
this call needs to go back into nfs_set_text().

git-svn-id: svn://svn.freebsd.org/base/stable/10@317476 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r316719
rmacklem [Wed, 26 Apr 2017 23:01:49 +0000 (23:01 +0000)]
MFC: r316719
Don't throw away Open state when a NFSv4.1 client recovery fails.

If the ExchangeID/CreateSession operations done by an NFSv4.1 client
after the server crashes/reboots fails, it is possible that some process/thread
is waiting for an open_owner lock. If the client state is free'd, this
can cause a crash.
This would not normally happen, but has been observed on a mount of the
AmazonEFS service.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317475 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r316717
rmacklem [Wed, 26 Apr 2017 22:53:29 +0000 (22:53 +0000)]
MFC: r316717
During a server crash recovery, fix the NFSv4.1 client for a NFSERR_BADSESSION
during recovery.

If the NFSv4.1 client gets a NFSv4.1 NFSERR_BADSESSION reply to an Open/Lock
operation while recovering from the server crash/reboot, allow the opens
to be retained for a subsequent recovery attempt. Since NFSv4.1 servers
should only reply NFSERR_BADSESSION after a crash/reboot that has lost
state, this case should almost never happen.
However, for the AmazonEFS file service, this has been observed when
the client does a fresh TCP connection for RPCs.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317474 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r316694
rmacklem [Wed, 26 Apr 2017 22:40:08 +0000 (22:40 +0000)]
MFC: r316694
Fix a crash during unmount of an NFSv4.1 mount.

Larry Rosenman reported a crash on freebsd-current@ which was caused by
a premature release of the krpc backchannel socket structure.
I believe this was caused by a race between the SVC_RELEASE() in clnt_vc.c
and the xprt_unregister() in the higher layer (clnt_rc.c), which tried
to lock the mutex in the xprt structure and crashed.
This patch fixes this by removing the xprt_unregister() in the clnt_vc
layer and allowing this to always be done by the clnt_rc (higher reconnect
layer).

git-svn-id: svn://svn.freebsd.org/base/stable/10@317473 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r317169:
gjb [Wed, 26 Apr 2017 16:27:20 +0000 (16:27 +0000)]
MFC r317169:
 Trim trailing '/release/..' when setting _OBJDIR so arm64/aarch64
 boot1.efifat is properly located when creating virtual machine images.

 Note, the underlying issue has no direct impact against stable/10,
 as arm64/aarch64 virtual machine images are not created for 10-STABLE.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@317442 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316810, r316814, r316816, r316991:
cy [Wed, 26 Apr 2017 02:37:25 +0000 (02:37 +0000)]
MFC r316810, r316814, r316816, r316991:

Keep state incorrectly assumes keep frags. This is counter to the
ipfilter man pages. This also currently restricts keep frags to only when
keep state is used, which is redundant because keep state currently
assumes keep frags. This commit fixes this.

To the user this change means that to maintain the current behaviour
one must add keep frags to any ipfilter keep state rule (as documented
in the man pages).

This patch also allows the flexability to specify and use keep frags
separate from keep state, as documented in an example in ipf.conf.5,
instead of the currently broken behaviour.

MFC suggested by: rgrimes
Relnotes: yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@317434 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r316692
rmacklem [Wed, 26 Apr 2017 00:03:03 +0000 (00:03 +0000)]
MFC: r316692
Set initial values for nfsstatfs in the NFSv4 client.

The AmazonEFS NFSv4.1 server does not support the FILES_FREE and FILES_TOTAL
attributes. As such, an NFSv4.1 mount to the server would return garbage
for these values. This patch initializes the fields of the nfsstatfs structure,
so that "df" and friends will at least return consistent bogus values.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317429 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r316669
rmacklem [Tue, 25 Apr 2017 20:34:56 +0000 (20:34 +0000)]
MFC: r316669
Avoid starvation of the server crash recovery thread for the NFSv4 client.

This patch gives a requestor of the exclusive lock on the client state
in the NFSv4 client priority over shared lock requestors. This avoids
the server crash recovery thread being starved out by other threads doing
RPCs.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317423 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r316667
rmacklem [Tue, 25 Apr 2017 19:48:25 +0000 (19:48 +0000)]
MFC: r316667
Fix the NFSv4 client hndling of a stale write verifier in the Commit operation.

When the NFSv4 client Commit operation encountered a stale write verifier,
it erroneously mapped that to EIO. This could have caused recently written
data to be lost when a server crashes/reboots between an UNSTABLE write
and the subsequent commit. This patch fixes this.
The bug was only for the NFSv4 client and did not affect NFSv3.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317420 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r316666
rmacklem [Tue, 25 Apr 2017 19:35:13 +0000 (19:35 +0000)]
MFC: r316666
Fix the NFSv4.1 client for NFSERR_BADSESSION recovery via ReclaimComplete.

For the ReclaimComplete operation, the RPC layer should not loop on
NFSERR_BADSESSION. If it does, the recovery thread (nfscl) can get stuck
looping and will not do a recovery.
This patch fixes it so it does not loop. This bug only affects NFSv4.1 and
only when a server reboots.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317419 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316698:
kib [Tue, 25 Apr 2017 13:17:34 +0000 (13:17 +0000)]
MFC r316698:
Remove debugging printf.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317408 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r316655
rmacklem [Tue, 25 Apr 2017 12:07:04 +0000 (12:07 +0000)]
MFC: r316655
Fix parsing failure for NFSv4 Setattr operation for failed case.

If an operation that preceeds a Setattr in an NFSv4 compound fails,
there is no bitmap of attributes to parse. Without this patch, the
parsing would fail and return EBADRPC instead of the correct failure
error. This could break recovery from a server crash/reboot.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317406 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r310491
rmacklem [Tue, 25 Apr 2017 11:36:25 +0000 (11:36 +0000)]
MFC: r310491
Fix NFSv4.1 client recovery from NFS4ERR_BAD_SESSION errors.

For most NFSv4.1 servers, a NFS4ERR_BAD_SESSION error is a rare failure
that indicates that the server has lost session/open/lock state.
However, recent testing by cperciva@ against the AmazonEFS server found
several problems with client recovery from this due to it generating this
failure frequently.
Briefly, the problems fixed are:
- If all session slots were in use at the time of the failure, some processes
  would continue to loop waiting for a slot on the old session forever.
- If an RPC that doesn't use open/lock state failed with NFS4ERR_BAD_SESSION,
  it would fail the RPC/syscall instead of initiating recovery and then
  looping to retry the RPC.
- If a successful reply to an RPC for an old session wasn't processed
  until after a new session was created for a NFS4ERR_BAD_SESSION error,
  it would erroneously update the new session and corrupt it.
- The use of the first element of the session list in the nfs mount
  structure (which is always the current metadata session) was slightly
  racey. With changes for the above problems it became more racey, so all
  uses of this head pointer was wrapped with a NFSLOCKMNT()/NFSUNLOCKMNT().
- Although the kernel malloc() usually allocates more bytes than requested
  and, as such, this wouldn't have caused problems, the allocation of a
  session structure was 1 byte smaller than it should have been.
  (Null termination byte for the string not included in byte count.)

There are probably still problems with a pNFS data server that fails
with NFS4ERR_BAD_SESSION, but I have no server that does this to test
against (the AmazonEFS server doesn't do pNFS), so I can't fix these yet.

Although this patch is fairly large, it should only affect the handling
of NFS4ERR_BAD_SESSION error replies from an NFSv4.1 server.
Thanks go to cperciva@ for the extension testing he did to help isolate/fix
these problems.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317404 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316768:
brooks [Mon, 24 Apr 2017 22:44:59 +0000 (22:44 +0000)]
MFC r316768:

Fix an out-of-bounds write when a zero-length buffer is passed.

Found with ttyname_test and CHERI bounds checking.

Reviewed by: emaste
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL

git-svn-id: svn://svn.freebsd.org/base/stable/10@317392 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316766:
brooks [Mon, 24 Apr 2017 21:41:04 +0000 (21:41 +0000)]
MFC r316766:

Correct an out of bounds read with HN_AUTOSCALE and very large numbers.

The maximum scale is 6 (K, M, G, T, P, E) (B is 0).

Overly large explict scales were checked correctly, but for sufficently
large numbers HN_AUTOSCALE would get to 7 resulting in an out of bounds
read.

Found with humanize_number_test and CHERI bounds checking.

Reviewed by: emaste
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL

git-svn-id: svn://svn.freebsd.org/base/stable/10@317387 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoPartial MFC r316676 and the required r313045
smh [Mon, 24 Apr 2017 16:31:28 +0000 (16:31 +0000)]
Partial MFC r316676 and the required r313045

MFC r316676:

Use estimated RTT for receive buffer auto resizing instead of timestamps.
This is a partial MFC as stable/10 doesn't include the TCP stack
modularisation.

MFC r313045:

Add an mbuf to ipinfo_t translator to finish cleanup of mbuf passing to TCP
probes. This is a partial MFC (missing debug__output & debug__drop changes)
due to the massive amount of additional dtrace changes that would be
required for a full MFC.

Relnotes: Yes
Sponsored by: Multiplay

git-svn-id: svn://svn.freebsd.org/base/stable/10@317375 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315913: Add brackets to fix incorrect macro expansion.
mav [Mon, 24 Apr 2017 11:22:06 +0000 (11:22 +0000)]
MFC r315913: Add brackets to fix incorrect macro expansion.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317367 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315908: Unify initiator and target DMA setup and command sending.
mav [Mon, 24 Apr 2017 11:21:32 +0000 (11:21 +0000)]
MFC r315908: Unify initiator and target DMA setup and command sending.

The code is so alike that it is pointless to keep it separate.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317366 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315870: isp field in struct isp_pcmd is also unused.
mav [Mon, 24 Apr 2017 11:20:55 +0000 (11:20 +0000)]
MFC r315870: isp field in struct isp_pcmd is also unused.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317365 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315869: Remove write-only crn field from struct isp_pcmd.
mav [Mon, 24 Apr 2017 11:20:21 +0000 (11:20 +0000)]
MFC r315869: Remove write-only crn field from struct isp_pcmd.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317364 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315708: Cleanup response queue processing.
mav [Mon, 24 Apr 2017 11:19:47 +0000 (11:19 +0000)]
MFC r315708: Cleanup response queue processing.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317363 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316677: Do not register in CTL portal groups without portals.
mav [Mon, 24 Apr 2017 06:33:08 +0000 (06:33 +0000)]
MFC r316677: Do not register in CTL portal groups without portals.

From config synthax point of view such portal groups are not incorrect,
but they are useless since can not receive any connection.  And since
CTL port resource is very limited, it is good to save it.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317352 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r317186
kp [Sun, 23 Apr 2017 08:59:57 +0000 (08:59 +0000)]
MFC r317186

pf: Fix possible incorrect IPv6 fragmentation

When forwarding pf tracks the size of the largest fragment in a fragmented
packet, and refragments based on this size.
It failed to ensure that this size was a multiple of 8 (as is required for all
but the last fragment), so it could end up generating incorrect fragments.

For example, if we received an 8 byte and 12 byte fragment pf would emit a first
fragment with 12 bytes of payload and the final fragment would claim to be at
offset 8 (not 12).

We now assert that the fragment size is a multiple of 8 in ip6_fragment(), so
other users won't make the same mistake.

Reported by:    Antonios Atlasis <aatlasis at secfu net>

git-svn-id: svn://svn.freebsd.org/base/stable/10@317335 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316652: Fix few minor issues found by Clang Analyzer.
mav [Sun, 23 Apr 2017 07:37:14 +0000 (07:37 +0000)]
MFC r316652: Fix few minor issues found by Clang Analyzer.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317322 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316653: Fix few minor issues found by Clang Analyzer.
mav [Sun, 23 Apr 2017 07:35:51 +0000 (07:35 +0000)]
MFC r316653: Fix few minor issues found by Clang Analyzer.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317320 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316993, r316994, r316997 as follows:
cy [Sun, 23 Apr 2017 03:16:38 +0000 (03:16 +0000)]
MFC r316993, r316994, r316997 as follows:

r316993:

Fix CID 1372601 in ipfilter/lib/parsefields.c, possible NULL pointer
dereference should reallocarray() fail.

Reported by: Coverity CID 1372601

r316994:

Fix CID 1372600 in ipfilter/tools/ipf_y.y, possible NULL pointer
dereference should reallocarray() fail.

Reported by: Coverity CID 1372600

r316997:

Use warnx() to issue error message.

Reported by: cem

git-svn-id: svn://svn.freebsd.org/base/stable/10@317314 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r314694
rgrimes [Sat, 22 Apr 2017 22:05:23 +0000 (22:05 +0000)]
MFC: r314694

  Make vmrun.sh passthrough -u and -w to bhybe

PR: 214273
Submitted by: Martin Birgmeier <la5lb...@aon.at>
Approved by: grehan (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@317303 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r314691
rgrimes [Sat, 22 Apr 2017 21:57:26 +0000 (21:57 +0000)]
MFC: r314691

Document 3 more src/ directories

Approved by: grehan (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@317302 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoDocument EN-17:01 through EN-17:05, SA-16:39 through SA-17:03
gjb [Fri, 21 Apr 2017 19:41:33 +0000 (19:41 +0000)]
Document EN-17:01 through EN-17:05, SA-16:39 through SA-17:03

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@317266 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316852:
kib [Fri, 21 Apr 2017 10:16:34 +0000 (10:16 +0000)]
MFC r316852:
In fsck_ffs pass1, prevent the inosused variable from wrapping.

PR: 218592

git-svn-id: svn://svn.freebsd.org/base/stable/10@317250 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r317139 for real.
cy [Fri, 21 Apr 2017 02:11:44 +0000 (02:11 +0000)]
MFC r317139 for real.

Restore prototype accidently removed by r316811.  Also remove $NetBSD$
accidentally added.

Reported by:    hps, lwhsu
Pointy hat to: cy

git-svn-id: svn://svn.freebsd.org/base/stable/10@317243 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316811, r317139:
cy [Fri, 21 Apr 2017 02:02:52 +0000 (02:02 +0000)]
MFC r316811, r317139:

Add missing free()'s after calls to randomize().

PR: NetBSD PR/50559
Obtained from: Netbsd radix_ipf.c r1.6

git-svn-id: svn://svn.freebsd.org/base/stable/10@317242 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316809:
cy [Fri, 21 Apr 2017 01:51:49 +0000 (01:51 +0000)]
MFC r316809:

Fix a use after free panic in ipfilter's fragment processing.
Memory is malloc'd, then a search for a match in the fragment table
is made and if the fragment matches, the wrong fragment table is
freed, causing a use after free panic. This commit fixes this.

A symptom of the problem is a kernel page fault in bcopy() called by
ipf_frag_lookup() at line 715 in ip_frag.c. Another symptom is a
kernel page fault in ipf_frag_delete() when called by ipf_frag_expire()
via ipf_slowtimer().

git-svn-id: svn://svn.freebsd.org/base/stable/10@317241 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316183
davidcs [Thu, 20 Apr 2017 04:33:47 +0000 (04:33 +0000)]
MFC r316183
Upgrade firmware and other related files to version 5.4.64

git-svn-id: svn://svn.freebsd.org/base/stable/10@317183 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316739:
kib [Wed, 19 Apr 2017 10:57:57 +0000 (10:57 +0000)]
MFC r316739:
Fix reporting of _SC_SEM_NSEMS_MAX and _SC_SEM_VALUE_MAX.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317131 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 316813,316815
sephe [Wed, 19 Apr 2017 05:28:21 +0000 (05:28 +0000)]
MFC 316813,316815

316813
    hyperv/storvsc: Use ULL for 64bits value shift.

    Reported by:    PVS
    Sponsored by:   Microsoft

316815
    hyperv/kvp: Remove always false condition.

    Reported by:    PVS
    Sponsored by:   Microsoft

git-svn-id: svn://svn.freebsd.org/base/stable/10@317125 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 316515,316812
sephe [Wed, 19 Apr 2017 05:19:33 +0000 (05:19 +0000)]
MFC 316515,316812

316515
    hyperv/kbd: Add support for synthetic keyboard.

    Synthetic keyboard is the only supported keyboard on GEN2 Hyper-V.

    Submitted by:   Hongjiang Zhang <honzhan microsoft com>
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D10196

316812
    hyperv/kbd: Remove unnecessary assignment.

    Reported by:    PVS
    Sponsored by:   Microsoft

git-svn-id: svn://svn.freebsd.org/base/stable/10@317124 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316747
davidcs [Wed, 19 Apr 2017 03:43:24 +0000 (03:43 +0000)]
MFC r316747
  Fix rss_ind_table entry for num_funcs > 1

git-svn-id: svn://svn.freebsd.org/base/stable/10@317123 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316720
davidcs [Wed, 19 Apr 2017 03:41:19 +0000 (03:41 +0000)]
MFC r316720
  Fix defects reported by Coverity
    1. Deadcode in ecore_init_cache_line_size(), qlnx_ioctl() and
     qlnx_clean_filters()
    2. ARRAY_VS_SINGLETON issue in qlnx_remove_all_mcast_mac() and
     qlnx_update_rx_prod()

git-svn-id: svn://svn.freebsd.org/base/stable/10@317122 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316485
davidcs [Wed, 19 Apr 2017 03:37:11 +0000 (03:37 +0000)]
MFC r316485
    Add 25/40/100Gigabit Ethernet Driver version v1.3.0 for Cavium Inc's.
    Qlogic 45000 Series Adapters

git-svn-id: svn://svn.freebsd.org/base/stable/10@317120 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 317107
sephe [Wed, 19 Apr 2017 03:06:27 +0000 (03:06 +0000)]
MFC 317107
    hyperv: Use kmem_malloc for hypercall memory due to NX bit change.

    Reported by:    dexuan@
    Sponsored by:   Microsoft

git-svn-id: svn://svn.freebsd.org/base/stable/10@317115 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316310
davidcs [Wed, 19 Apr 2017 02:59:26 +0000 (02:59 +0000)]
MFC r316310
Update man page for commit r316309 "Add support for optional Soft LRO".
The driver provides the ability to select either HW or Software LRO, when
LRO is enabled (default HW LRO).

git-svn-id: svn://svn.freebsd.org/base/stable/10@317112 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316309
davidcs [Wed, 19 Apr 2017 02:58:14 +0000 (02:58 +0000)]
MFC r316309
Add support for optional Soft LRO

git-svn-id: svn://svn.freebsd.org/base/stable/10@317111 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r285117
asomers [Tue, 18 Apr 2017 16:17:38 +0000 (16:17 +0000)]
MFC r285117

Make cleanup routines idempotent

cleanup routines can be executed at any point during the execution of the
body, including even before the body has done any real work.  In those
cases, cleanup routines should be careful to not raise spurious errors so
as to not "override" the actual result of the test case.

This is just general good coding style but is not a problem in practice
for these specific tests.  (The way I discovered the issue, though, was
due to a regression I introduced in Kyua itself while refactoring some
internals.)

MFC after:      1 week

git-svn-id: svn://svn.freebsd.org/base/stable/10@317093 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316716:
ae [Tue, 18 Apr 2017 09:22:06 +0000 (09:22 +0000)]
MFC r316716:
  Inherit IPv6 checksum offloading flags to vlan interfaces.

  if_vlan(4) interfaces inherit IPv4 checksum offloading flags from the
  parent when VLAN_HWCSUM and VLAN_HWTAGGING flags are present on the
  parent interface. Do the same for IPv6 checksum offloading flags.

  Reported by: Harry Schmalzbauer
  Reviewed by: np, gnn
  Differential Revision: https://reviews.freebsd.org/D10356

git-svn-id: svn://svn.freebsd.org/base/stable/10@317082 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316956:
bapt [Mon, 17 Apr 2017 19:10:12 +0000 (19:10 +0000)]
MFC r316956:

Update pci_vendors to 2017.04.03

git-svn-id: svn://svn.freebsd.org/base/stable/10@317066 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316427, r316428: Add Log directory and SATA NCQ Send and Receive Log.
mav [Sun, 16 Apr 2017 06:00:14 +0000 (06:00 +0000)]
MFC r316427, r316428: Add Log directory and SATA NCQ Send and Receive Log.

Those are used at least by Linux guests to detect queued TRIM support.

git-svn-id: svn://svn.freebsd.org/base/stable/10@317001 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315948:
dchagin [Sat, 15 Apr 2017 11:16:11 +0000 (11:16 +0000)]
MFC r315948:

Update tcsh to 6.20.00

MFC r315952:

Update tcsh to vendor git b605cb561d

Vendor changes:

1. PR/471: Daiki Ueno: Delay interpreting arginp until we've processed
our startup files (which can change the NLS environment).

2. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar).

3. Fix out of bounds read (Brooks Davis)
(reproduce by starting tcsh and hitting tab at the prompt).

4. Don't play pointer tricks that are undefined in modern c
(Brooks Davis).

git-svn-id: svn://svn.freebsd.org/base/stable/10@316958 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314686: sh: Fix crash if a -T trap is taken during command substitution.
jilles [Fri, 14 Apr 2017 21:42:27 +0000 (21:42 +0000)]
MFC r314686: sh: Fix crash if a -T trap is taken during command substitution.

Code like  t=$(stat -f %m "$file")  segfaulted if -T was active and a trap
was taken while the shell was waiting for the child process to finish.

What happened was that the dotrap() call in waitforjob() was hit. This
re-entered command execution (including expand.c) at a point not expected by
expbackq(), and global state (unallocated stack string and argbackq) was
corrupted.

To fix this, change expbackq() to prepare for command execution to be
re-entered.

In stable/10, there is more global state that needs to be restored than in
stable/11 and head.

Reported by: bdrewery

git-svn-id: svn://svn.freebsd.org/base/stable/10@316942 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agofix mismerge in r316846, MFC of r315858
avg [Fri, 14 Apr 2017 16:40:10 +0000 (16:40 +0000)]
fix mismerge in r316846, MFC of r315858

git-svn-id: svn://svn.freebsd.org/base/stable/10@316857 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315852: zfs: add zio_buf_alloc_nowait and use it in vdev_queue_aggregate
avg [Fri, 14 Apr 2017 15:09:30 +0000 (15:09 +0000)]
MFC r315852: zfs: add zio_buf_alloc_nowait and use it in vdev_queue_aggregate

git-svn-id: svn://svn.freebsd.org/base/stable/10@316850 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315853: zfs_putpages: use TXG_WAIT
avg [Fri, 14 Apr 2017 15:07:55 +0000 (15:07 +0000)]
MFC r315853: zfs_putpages: use TXG_WAIT

git-svn-id: svn://svn.freebsd.org/base/stable/10@316848 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315858: aacraid: rework r315083 for a clean build with and without AACRAID_DEBUG
avg [Fri, 14 Apr 2017 15:06:22 +0000 (15:06 +0000)]
MFC r315858: aacraid: rework r315083 for a clean build with and without AACRAID_DEBUG

git-svn-id: svn://svn.freebsd.org/base/stable/10@316846 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315960: dtrace sched:::preempt should fire only when there is preemption
avg [Fri, 14 Apr 2017 14:45:44 +0000 (14:45 +0000)]
MFC r315960: dtrace sched:::preempt should fire only when there is preemption

git-svn-id: svn://svn.freebsd.org/base/stable/10@316843 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315851: move thread switch tracing from mi_switch to sched_switch
avg [Fri, 14 Apr 2017 14:44:06 +0000 (14:44 +0000)]
MFC r315851: move thread switch tracing from mi_switch to sched_switch

git-svn-id: svn://svn.freebsd.org/base/stable/10@316841 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315078: uma: fix pages <-> items conversions at several places
avg [Fri, 14 Apr 2017 14:41:31 +0000 (14:41 +0000)]
MFC r315078: uma: fix pages <-> items conversions at several places

git-svn-id: svn://svn.freebsd.org/base/stable/10@316839 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r286583: Avoid sign extension of value passed to kva_alloc from uma_zone_reserve_kva
avg [Fri, 14 Apr 2017 14:39:58 +0000 (14:39 +0000)]
MFC r286583: Avoid sign extension of value passed to kva_alloc from uma_zone_reserve_kva

On behalf of: zbb

git-svn-id: svn://svn.freebsd.org/base/stable/10@316838 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315077: uma: eliminate uk_slabsize field
avg [Fri, 14 Apr 2017 14:11:59 +0000 (14:11 +0000)]
MFC r315077: uma: eliminate uk_slabsize field

git-svn-id: svn://svn.freebsd.org/base/stable/10@316835 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316593:
brooks [Fri, 14 Apr 2017 00:15:34 +0000 (00:15 +0000)]
MFC r316593:

Point out that -F probably does not do what the user expects.

Users attempting to create images from mtree METALOG files created by
installworld often use -F when they should be passing the METALOG file
in place of a directory. This is often produces difficult to debug
error reports.

Reviewed by: emaste
Sponsored by: DARPA, AFRL

git-svn-id: svn://svn.freebsd.org/base/stable/10@316800 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316066:
bdrewery [Thu, 13 Apr 2017 20:36:40 +0000 (20:36 +0000)]
MFC r316066:

  Release ccb if mode_buffer allocation fails.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316791 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315691:
bdrewery [Thu, 13 Apr 2017 20:34:02 +0000 (20:34 +0000)]
MFC r315691:

  Rename _cc to _gcc to be more clear.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316787 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315211:
bdrewery [Thu, 13 Apr 2017 20:32:34 +0000 (20:32 +0000)]
MFC r315211:

  hier(7): Fix entry location for /usr/share/vt.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316785 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r291310:
ian [Thu, 13 Apr 2017 19:48:45 +0000 (19:48 +0000)]
MFC r291310:

Stop building vers.c in include/ and only build the needed osreldate.h.

Because of how osreldate.h was being built with newvers.sh, which always
spat out a vers.c dependent on SVN or git, the meta mode build was
considering osreldate.h to depend on the current git or SVN index.  This
would lead to entire tree rebuilds when modifying git's index.  There's
no reason to be generating vers.c here so just skip it.

While here, in mk-osreldate.sh rename PARAM_H to proper PARAMFILE (which
newvers.sh already has a default for) and remove unneeded export.

Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@316781 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f