]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agogetpw_test: fix -Wunused warnings
ngie [Sun, 28 May 2017 04:41:06 +0000 (04:41 +0000)]
getpw_test: fix -Wunused warnings

- Mark unused parameters __unused.
- Put dump_passwd under DEBUG as it's only used in that case.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agogethostby_test: fix multiple warning types
ngie [Sun, 28 May 2017 04:34:57 +0000 (04:34 +0000)]
gethostby_test: fix multiple warning types

- Fix -Wmissing-declaration warning by staticizing run_tests.
- Fix -Wsign-compare warnings by casting size_t types to int
  for comparisons.

Reindent some of the code in sdump_hostent(..) to accomodate the
overall changes.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agogetproto_test: fix -Wunused warnings
ngie [Sun, 28 May 2017 04:15:57 +0000 (04:15 +0000)]
getproto_test: fix -Wunused warnings

Mark unused parameters __unused in functions.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agogetrpc_test: fix -Wunused warnings
ngie [Sun, 28 May 2017 04:15:05 +0000 (04:15 +0000)]
getrpc_test: fix -Wunused warnings

- Mark unused function parameters unused.
- Remove an unused function prototype.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agogetserv_test: mark unused parameters __unused to fix corresponding
ngie [Sun, 28 May 2017 04:12:52 +0000 (04:12 +0000)]
getserv_test: mark unused parameters __unused to fix corresponding
warnings

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agogetusershell_test: mark mdata parameter in compare_usershell __unused
ngie [Sun, 28 May 2017 04:12:02 +0000 (04:12 +0000)]
getusershell_test: mark mdata parameter in compare_usershell __unused

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agogetaddrinfo_test: mark unused function parameters __unused to fix -Wunused
ngie [Sun, 28 May 2017 04:11:04 +0000 (04:11 +0000)]
getaddrinfo_test: mark unused function parameters __unused to fix -Wunused
warnings

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agogetproto_test: fix -Wmissing-prototypes and -Wsign-compare warnings
ngie [Sun, 28 May 2017 04:05:19 +0000 (04:05 +0000)]
getproto_test: fix -Wmissing-prototypes and -Wsign-compare warnings

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agogetrpc_test: fix -Wmissing-prototypes and -Wsign-compare warnings
ngie [Sun, 28 May 2017 04:04:32 +0000 (04:04 +0000)]
getrpc_test: fix -Wmissing-prototypes and -Wsign-compare warnings

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agogetaddrinfo_test: fix -Wsign-compare warnings
ngie [Sun, 28 May 2017 04:03:45 +0000 (04:03 +0000)]
getaddrinfo_test: fix -Wsign-compare warnings

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agogetserv_test: fix -Wsign-compare and -Wmissing-prototypes warnings
ngie [Sun, 28 May 2017 04:03:06 +0000 (04:03 +0000)]
getserv_test: fix -Wsign-compare and -Wmissing-prototypes warnings

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agogetusershell_test: staticize run_tests(..) to fix warnings
ngie [Sun, 28 May 2017 03:58:36 +0000 (03:58 +0000)]
getusershell_test: staticize run_tests(..) to fix warnings

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoFix -Wsign-compare warnings
ngie [Sun, 28 May 2017 03:47:58 +0000 (03:47 +0000)]
Fix -Wsign-compare warnings

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoStaticize functions and remove unused variables to aid with bumping WARNS
ngie [Sun, 28 May 2017 03:42:49 +0000 (03:42 +0000)]
Staticize functions and remove unused variables to aid with bumping WARNS

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoSort make variables to suit style.Makefile(5)
ngie [Sun, 28 May 2017 03:39:24 +0000 (03:39 +0000)]
Sort make variables to suit style.Makefile(5)

This is being done prior to functional changes.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agolib/libc/tests/nss: use calloc appropriately
ngie [Sun, 28 May 2017 02:55:04 +0000 (02:55 +0000)]
lib/libc/tests/nss: use calloc appropriately

The pattern used prior to this commit was `calloc(1, n * sizeof(type))`;
the pattern that should be used however is `calloc(n, sizeof(type))`.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agopw: add some basic testcases for groupshow and usershow
ngie [Sun, 28 May 2017 02:15:57 +0000 (02:15 +0000)]
pw: add some basic testcases for groupshow and usershow

- groupshow: test out -a/-g/-n .
- usershow: test out -a/-n/-u .

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoFix INSTALL_AS_USER with external nsswitch databases
vangyzen [Sun, 28 May 2017 00:45:28 +0000 (00:45 +0000)]
Fix INSTALL_AS_USER with external nsswitch databases

The INSTALL_AS_USER option tells "install" to use the current
user name as the owner of the installed file.  The "install"
command executed by the build is statically linked, so it does not
load nsswitch modules, such as nss_ldap.so, so it fails when
the user is only defined in such a database.

Fix it to use the current UID instead of user name.  This works
for all users.  I expect it is also slightly more efficient.

Reviewed by: sjg
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10862

7 years agoFix INSTALL_AS_USER
vangyzen [Sun, 28 May 2017 00:43:12 +0000 (00:43 +0000)]
Fix INSTALL_AS_USER

Move INSTALL_AS_USER into bsd.init.mk to maximize the chance that
it has final authority over fooOWN and fooGRP.

Reviewed by: sjg
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10810

7 years agoRemove getpagesize(3) error checking added in r317312
ngie [Sun, 28 May 2017 00:28:11 +0000 (00:28 +0000)]
Remove getpagesize(3) error checking added in r317312

getpagesize(3) no longer fails as of r317436.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoUse calloc instead of malloc + memset
ngie [Sat, 27 May 2017 23:57:09 +0000 (23:57 +0000)]
Use calloc instead of malloc + memset

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoFix #if conditional added in r319008
ngie [Sat, 27 May 2017 23:23:22 +0000 (23:23 +0000)]
Fix #if conditional added in r319008

I committed an earlier version of the file by accident

This is a no-op on ^/head and ^/stable/11.

MFC after: now
Sponsored by: Dell EMC Isilon

7 years agokvm_geterr_test: Compile out the portions that require kvm_open2(3) on
ngie [Sat, 27 May 2017 23:19:32 +0000 (23:19 +0000)]
kvm_geterr_test: Compile out the portions that require kvm_open2(3) on
systems that lack the libcall, based on __FreeBSD_version.

kvm_open2(3) wasn't made available until r291406, which is in ^/stable/11,
but not ^/stable/10. This makes some of kvm_geterr_test available for testing
on ^/stable/10.

MFC after: now
Sponsored by: Dell EMC Isilon

7 years ago:rgrep : use atf-check to check the exit code/save the output of grep -r instead
ngie [Sat, 27 May 2017 22:40:20 +0000 (22:40 +0000)]
:rgrep : use atf-check to check the exit code/save the output of grep -r instead
of calling grep -r without it, and saving the output to a file

This ensures that any errors thrown via grep -r are caught, not lost, and uses
existing atf-sh idioms for saving files.

Tested with: bsdgrep, gnu grep (base, ports)
Sponsored by: Dell EMC Isilon

7 years agoAfter r118390, the variable "dmmax" was neither the correct strip size
alc [Sat, 27 May 2017 21:46:00 +0000 (21:46 +0000)]
After r118390, the variable "dmmax" was neither the correct strip size
nor the correct maximum block size.  Moreover, after r318995, it serves
no purpose except to provide information to user space through a read-
sysctl.

This change eliminates the variable "dmmax" but retains the sysctl.  It
also corrects the value returned by the sysctl.

Reviewed by: kib, markj
MFC after: 3 days

7 years agoAlign text correctly by using tabs instead of spaces.
pfg [Sat, 27 May 2017 20:01:50 +0000 (20:01 +0000)]
Align text correctly by using tabs instead of spaces.

The text was copy-pasted from the lines that carry the bogus spaces.
This is a non-functional change.

7 years agoUpdate the comments concerning net_parse_rootpath to reflect what it is now
bapt [Sat, 27 May 2017 18:46:00 +0000 (18:46 +0000)]
Update the comments concerning net_parse_rootpath to reflect what it is now
really doing

Reported by: rgrimes
Reviewed by: rgrimes
Differential Revision: https://reviews.freebsd.org/D10959

7 years agoFix return value of ip_sync_nat. Previously, regardless of error it
cy [Sat, 27 May 2017 18:01:14 +0000 (18:01 +0000)]
Fix return value of ip_sync_nat. Previously, regardless of error it
always returned a return code of 0.

Obtained from: NetBSD ip_sync.c r1.5
MFC after: 1 week

7 years agoUse whole mnt_stat.f_fsid bits for st_dev.
kib [Sat, 27 May 2017 17:00:30 +0000 (17:00 +0000)]
Use whole mnt_stat.f_fsid bits for st_dev.

Since ino64 expanded dev_t to 64bit, make VOP_GETATTR(9) provide all
bits of mnt_stat.f_fsid as va_fsid for vnodes on filesystems which use
f_fsid.  In particular, NFSv3 and sometimes NFSv4, and ZFS use this
method or reporting st_dev by stat(2).

Provide a new helper vn_fsid() to avoid duplicating code to copy
f_fsid to va_fsid.

Note that the change is mostly cosmetic.  Its motivation is to avoid
sign-extension of f_fsid[0] into 64bit dev_t value which happens after
dev_t becomes 64bit..

Reviewed by: avg(zfs), rmacklem (nfs) (both for previous version)
Sponsored by: The FreeBSD Foundation

7 years agoAdd descriptions for AES-GCM IPSec authentication (AH) counters.
jhb [Sat, 27 May 2017 16:53:39 +0000 (16:53 +0000)]
Add descriptions for AES-GCM IPSec authentication (AH) counters.

MFC after: 1 week
Sponsored by: Chelsio Communications

7 years agoIn r118390, the swap pager's approach to striping swap allocation over
alc [Sat, 27 May 2017 16:40:00 +0000 (16:40 +0000)]
In r118390, the swap pager's approach to striping swap allocation over
multiple devices was changed.  However, swapoff_one() was not fully and
correctly converted.  In particular, with r118390's introduction of a per-
device blist, the maximum swap block size, "dmmax", became irrelevant to
swapoff_one()'s operation.  Moreover, swapoff_one() was performing out-of-
range operations on the per-device blist that were silently ignored by
blist_fill().

This change corrects both of these problems with swapoff_one(), which will
allow us to potentially increase MAX_PAGEOUT_CLUSTER.  Previously,
swapoff_one() would panic inside of blist_fill() if you increased
MAX_PAGEOUT_CLUSTER.

Reviewed by: kib, markj
MFC after: 3 days

7 years agoCatch with the change in the user class
bapt [Sat, 27 May 2017 14:07:46 +0000 (14:07 +0000)]
Catch with the change in the user class

7 years agoUse the usual FreeBSD spelling for the DHCP user class
bapt [Sat, 27 May 2017 14:06:57 +0000 (14:06 +0000)]
Use the usual FreeBSD spelling for the DHCP user class

Reported by: lidl

7 years agoCapitalize DHCP
bapt [Sat, 27 May 2017 13:55:20 +0000 (13:55 +0000)]
Capitalize DHCP

Reported by: danfe

7 years agoDocument recent changes on pxeboot
bapt [Sat, 27 May 2017 13:26:18 +0000 (13:26 +0000)]
Document recent changes on pxeboot

7 years agoPartially revert r314948
bapt [Sat, 27 May 2017 12:46:46 +0000 (12:46 +0000)]
Partially revert r314948

While it sounds like a good idea to extract the RFC1048 data from PXE, in the
end it is not and it is causing lots of issues.  Our pxeloader might need
options which are incompatible with other pxe servers (for example iPXE, but
not only).

Our pxe loaders are also now settings their own user class, so it is useful to
issue our own pxe request at startup

Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D10953

7 years agoAlways issue the pxe request
bapt [Sat, 27 May 2017 12:35:01 +0000 (12:35 +0000)]
Always issue the pxe request

All the code are now only issueing one single dhcp request at startup of the
loader meaning we can always request a the PXE informations from the
dhcp server.

Previous code lost that information, meaning no option 55 anymore (meaning not
working with the kea dhcp server) and no request for rootpath etc, no user class

Remove the flags from the bootp function which is not needed anymore

Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D10952

7 years agoAlways build tftpfs support along with nfs for pxeboot
bapt [Sat, 27 May 2017 12:20:13 +0000 (12:20 +0000)]
Always build tftpfs support along with nfs for pxeboot

This change was already done for loader.efi

7 years agoSupport URI scheme for root-path in netbooting
bapt [Sat, 27 May 2017 12:06:52 +0000 (12:06 +0000)]
Support URI scheme for root-path in netbooting

Rather that previous attempts to add tftpfs support at the same time as NFS
support. This time decide on a proper URI parser rather than hacks.

root-path can now be define the following way:
For tftpfs:

tftp://ip/path
tftp:/path (this one will consider the tftp server is the same as the one where
the pxeboot file was fetched from)

For nfs:
nfs:/path
nfs://ip/path

The historical
ip:/path
/path

are kept on NFS

Reviewed by: tsoom, rgrimes
Differential Revision: https://reviews.freebsd.org/D10947

7 years agoadd a comment on vendor index 19 and 20 to avoid confusion
bapt [Sat, 27 May 2017 11:41:54 +0000 (11:41 +0000)]
add a comment on vendor index 19 and 20 to avoid confusion

Suggested by: tsoome

7 years agoPass a "FREEBSD" user-class in PXE dhcp request
bapt [Sat, 27 May 2017 10:50:35 +0000 (10:50 +0000)]
Pass a "FREEBSD" user-class in PXE dhcp request

rfc3004 allows to pass multiple user classes on dhcp requests
this is used by dhcp servers to differentiate the caller if needed.

As an example with isc dhcp server it will be possible to make options
only for the FreeBSD loaders:

if exists user-class and option user-class = "FREEBSD" {
   option root-path "tftp://192.168.42.1/FreeBSD;
}

Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D10951

7 years agoTighten /entropy permissions.
delphij [Sat, 27 May 2017 06:24:06 +0000 (06:24 +0000)]
Tighten /entropy permissions.

PR: 219527
Reported by: Lu Tung-Pin <lutungpin at openmailbox.org>
Submitted by: jilles
MFC after: 3 days

7 years agouart: add AMT SOL PCI ID
emaste [Sat, 27 May 2017 02:07:22 +0000 (02:07 +0000)]
uart: add AMT SOL PCI ID

I adjusted the description to be similar to existing AMT entries.

PR: 219384
Submitted by: "Tooker"
MFC after: 1 week

7 years agolibcxgb4: Use memcpy instead of copying WRs 8B at a time in the userspace
np [Sat, 27 May 2017 02:05:21 +0000 (02:05 +0000)]
libcxgb4: Use memcpy instead of copying WRs 8B at a time in the userspace
RDMA library for cxgbe(4).

MFC after: 3 days
Sponsored by: Chelsio Communications

7 years agoCall VLAN_CAPABILITIES() when LAGG capabilities change.
mav [Fri, 26 May 2017 22:22:48 +0000 (22:22 +0000)]
Call VLAN_CAPABILITIES() when LAGG capabilities change.

This makes VLAN on top of LAGG to expose proper capabilities if they are
changed after creation.

MFC after: 1 week

7 years agoprocstat(1): Add TCP socket send/recv buffer size
cem [Fri, 26 May 2017 22:17:44 +0000 (22:17 +0000)]
procstat(1): Add TCP socket send/recv buffer size

Add TCP socket send and receive buffer size to procstat -f output.

Reviewed by: kib, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D10689

7 years agoAdd missing usage and getopt(3) options
brooks [Fri, 26 May 2017 21:10:01 +0000 (21:10 +0000)]
Add missing usage and getopt(3) options

- Add the missing option 'n' to the getopt(3) string
- Add the missing options 'libxo' and 'N' to the usage message
- Add the missing options 'M' and 'N' to the man-page

Submitted by: Keegan Drake H.P. <kdrakehp@zoho.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D10915

7 years agoFail large requests with EFBIG.
jhb [Fri, 26 May 2017 20:20:40 +0000 (20:20 +0000)]
Fail large requests with EFBIG.

The adapter firmware in general does not accept PDUs larger than 64k - 1
bytes in size.  Sending crypto requests larger than this size result in
hangs or incorrect output, so reject them with EFBIG.  For requests
chaining an AES cipher with an HMAC, the firmware appears to require
slightly smaller requests (around 512 bytes).

Sponsored by: Chelsio Communications

7 years agoImprove applying unified capabilities to the lagg ports.
mav [Fri, 26 May 2017 20:15:33 +0000 (20:15 +0000)]
Improve applying unified capabilities to the lagg ports.

Some NICs have some capabilities dependent, so that disabling one require
disabling some other (TXCSUM/RXCSUM on em).  This code tries to reach the
consensus more insistently.

PR: 219453
MFC after: 1 week

7 years agoAllow PROBE_SPINUP to fail in CAM ATA transport
avg [Fri, 26 May 2017 17:44:47 +0000 (17:44 +0000)]
Allow PROBE_SPINUP to fail in CAM ATA transport

The motivation for this is two-fold.

1. Some old WD SATA disks may appear as if they need to be spun up
when they are already spinning.  Those disks would respond with
an error to the spin-up request.

2. Even if we really fail to spin up the disk, we still can try to
proceed to the subsequent phases.  If we fail later on, then no
difference.  Otherwise we get a chance to communicate with the
disk which is better than completely ignoring it, because a user
can try to recover the disk.

Reviewed by: mav
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D10896

7 years agoAdd newsyslog capability to write RFC5424 compliant rotation message.
dab [Fri, 26 May 2017 16:36:30 +0000 (16:36 +0000)]
Add newsyslog capability to write RFC5424 compliant rotation message.

This modification adds the capability to newsyslog to write the
rotation message in a format that is compliant with RFC5424. This
capability is enabled on a per-log file basis through a new value
("T") in the flags field in newsyslog.conf. This is useful on systems
that use the RFC5424 format for log files so that the rotation message
format matches that of the other log messages. There has been recent
mention of adding an RFC5424 compliant mode to syslogd and at least
one alternative system log daemon (rsyslogd) that already has the
capability to use that format.

Reviewed by: vangyzen, ngie
Approved by: vangyzen (mentor)
MFC after: 2 months
Relnotes: yes
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10253

7 years agoDefine a new __INO64 macro in <sys/_types.h>, to indicate the system
dim [Fri, 26 May 2017 16:29:55 +0000 (16:29 +0000)]
Define a new __INO64 macro in <sys/_types.h>, to indicate the system
uses 64-bit inode numbers.  Programs can use this to avoid including
<sys/param.h>, with its associated namespace pollution.

Reviewed by: kib

7 years agoUse the SCTP_PCB_FLAGS_ACCEPTING flags to check for listeners.
tuexen [Fri, 26 May 2017 16:29:00 +0000 (16:29 +0000)]
Use the SCTP_PCB_FLAGS_ACCEPTING flags to check for listeners.

While there, use a macro for checking the listen state to allow for
easier changes if required.

This done to help glebius@ with his listen changes.

7 years agorm stale ptrace dependencies after r305012
emaste [Fri, 26 May 2017 16:03:28 +0000 (16:03 +0000)]
rm stale ptrace dependencies after r305012

This is similar to r318912, except that ptrace.[sS] was previously a
file in the source tree, not a generated assembly wrapper.

Check for the existence of ptrace.[sS] in the .depend file to determine
if we have to clean it up.  This is a bit hackish and will not be left
in place indefinitely, but provides a useful example case when
investigating a better solution in bmake.

Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10930

7 years agolibthr: increase WARNS to the default (6)
vangyzen [Fri, 26 May 2017 15:57:54 +0000 (15:57 +0000)]
libthr: increase WARNS to the default (6)

...and silence cast-align warnings from gcc.

Reviewed by: kib
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10935

7 years agolibthr: fix warnings at WARNS=6
vangyzen [Fri, 26 May 2017 15:56:28 +0000 (15:56 +0000)]
libthr: fix warnings at WARNS=6

Fix more warnings about redundant declarations.

Reviewed by: kib emaste
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10932

7 years agortld: fix warnings about redundant declarations
vangyzen [Fri, 26 May 2017 15:55:03 +0000 (15:55 +0000)]
rtld: fix warnings about redundant declarations

Fix warnings about redundant declarations in rtld
when libthr in increased to WARNS=6.

Reviewed by: kib
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10934

7 years agolibthr: fix style in previous commit
vangyzen [Fri, 26 May 2017 15:53:27 +0000 (15:53 +0000)]
libthr: fix style in previous commit

I intended to add this to the previous commit.

Reviewed by: kib
MFC after: 3 days
Sponsored by: Dell EMC

7 years agolibthr: prevent setcontext() from masking SIGTHR
vangyzen [Fri, 26 May 2017 15:51:51 +0000 (15:51 +0000)]
libthr: prevent setcontext() from masking SIGTHR

__thr_setcontext() mistakenly tested for the presence of SIGCANCEL
in its local ucontext_t instead of the parameter. Therefore,
if a thread calls setcontext() with a context whose signal mask
contains SIGTHR (a.k.a. SIGCANCEL), that signal will be blocked,
preventing the thread from being cancelled or suspended.

Reported by: gcc 6.1 via RISC-V tinderbox
Reviewed by: kib
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10933

7 years agomakefs: add -O (offset) option
emaste [Fri, 26 May 2017 15:49:20 +0000 (15:49 +0000)]
makefs: add -O (offset) option

NetBSD revs:
ffs.c 1.60
makefs.8 1.44
makefs.c 1.48
makefs.h 1.33
ffs/buf.c 1.20
ffs/mkfs.c 1.27

Obtained from: NetBSD
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10780

7 years agoMFV r318944: 8265 Reserve send stream flag for large dnode feature
avg [Fri, 26 May 2017 12:08:38 +0000 (12:08 +0000)]
MFV r318944: 8265 Reserve send stream flag for large dnode feature

illumos/illumos-gate@bc83969fdbd1cb0d97ba00218c0a3de5c89fba92
https://github.com/illumos/illumos-gate/commit/bc83969fdbd1cb0d97ba00218c0a3de5c89fba92

https://www.illumos.org/issues/8265
  Reserve bit 23 in the zfs send stream flags for the large
  dnode feature which has been implemented for Linux.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Brian Behlendorf <behlendorf1@llnl.gov>

MFC after: 1 week

7 years agoMFV r318942: 8166 zpool scrub thinks it repaired offline device
avg [Fri, 26 May 2017 12:04:21 +0000 (12:04 +0000)]
MFV r318942: 8166 zpool scrub thinks it repaired offline device

illumos/illumos-gate@2d2f193a21231a58c583466dc23ba71f1a25f424
https://github.com/illumos/illumos-gate/commit/2d2f193a21231a58c583466dc23ba71f1a25f424

https://www.illumos.org/issues/8166
  If we do a scrub while a leaf device is offline (via "zpool offline"),
  we will inadvertently clear the DTL (dirty time log) of the offline
  device, even though it is still damaged. When the device comes back
  online, we will incompletely resilver it, thinking that the scrub
  repaired blocks written before the scrub was started. The incomplete
  resilver can lead to data loss if there is a subsequent failure of a
  different leaf device.
  The fix is to never clear the DTL of offline devices. Note that if a
  device is onlined while a scrub is in progress, the scrub will be
  restarted.
  The problem can be worked around by running "zpool scrub" after
  "zpool online".
  See also https://github.com/zfsonlinux/zfs/issues/5806

Reviewed by: George Wilson george.wilson@delphix.com
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoMFV r318934: 8070 Add some ZFS comments
avg [Fri, 26 May 2017 11:49:42 +0000 (11:49 +0000)]
MFV r318934: 8070 Add some ZFS comments

illumos/illumos-gate@40713f2b249d289022c715107b3951055a63aef0
https://github.com/illumos/illumos-gate/commit/40713f2b249d289022c715107b3951055a63aef0

https://www.illumos.org/issues/8070
  Add some ZFS comments left by various developers at different times

Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Alan Somers <asomers@gmail.com>

MFC after: 1 week

7 years agoMFV r318931: 8063 verify that we do not attempt to access inactive txg
avg [Fri, 26 May 2017 11:37:11 +0000 (11:37 +0000)]
MFV r318931: 8063 verify that we do not attempt to access inactive txg

illumos/illumos-gate@b7b2590dd9f11b12a0b4878db3886068cce176af
https://github.com/illumos/illumos-gate/commit/b7b2590dd9f11b12a0b4878db3886068cce176af

https://www.illumos.org/issues/8063
  A standard practice in ZFS is to keep track of "per-txg" state. Any of
  the 3 active TXG's (open, quiescing, syncing) can have different values
  for this state. We should assert that we do not attempt to modify other
  (inactive) TXG's.

Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

MFC after: 2 weeks

7 years agoMFV r318929: 7786 zfs`vdev_online() needs better notification about state changes
avg [Fri, 26 May 2017 11:33:34 +0000 (11:33 +0000)]
MFV r318929: 7786 zfs`vdev_online() needs better notification about state changes

illumos/illumos-gate@5f368aef86387d6ef4eda84030ae9b402313ee4c
https://github.com/illumos/illumos-gate/commit/5f368aef86387d6ef4eda84030ae9b402313ee4c

https://www.illumos.org/issues/7786
  Currently, vdev_online() will only post sysevent if previous state was
  "offline". It should also post the event when the state changes from "removed"
  or "faulted" to "healthy" or "degraded".
  This will fix the following scenario:
  - pull disk from slot A
  - check that hotspare has taken its place (if available)
  - insert disk into slot B
  - check that hotspare moved back to "avail" state (if spare was used)
  The problem here is that we don't get any ESC_ZFS_VDEV_* notification and fail
  to update the vdev FRU.

Reviewed by: Matthew Ahrens mahrens@delphix.com
Reviewed by: George Wilson george.wilson@delphix.com
Approved by: Albert Lee <trisk@forkgnu.org>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

MFC after: 1 week

7 years agoMFV r318927: 8025 dbuf_read() creates unnecessary zio_root() for bonus buf
avg [Fri, 26 May 2017 11:30:55 +0000 (11:30 +0000)]
MFV r318927: 8025 dbuf_read() creates unnecessary zio_root() for bonus buf

illumos/illumos-gate@def4fac5882b4ca67bd0f4a53509b6d1fa8ae14e
https://github.com/illumos/illumos-gate/commit/def4fac5882b4ca67bd0f4a53509b6d1fa8ae14e

https://www.illumos.org/issues/8025
  dbuf_read() creates a zio_root() to track and wait for all the zio's
  that may happen as part of this call. However, if the blkptr_t for
  this buffer is NULL or a hole, we will not create any more zio's, so
  this zio_root() is unnecessary. This is always the case when calling
  dbuf_read() on a bonus buffer, because it has no blkptr (it's part of
  the containing dnode). For workloads that read a lot of bonus buffers
  (e.g. file creation and removal), creating and destroying these
  unnecessary zio's can decrease performance by around 3%.

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoMFV r316929: 6914 kernel virtual memory fragmentation leads to hang
avg [Fri, 26 May 2017 11:23:16 +0000 (11:23 +0000)]
MFV r316929: 6914 kernel virtual memory fragmentation leads to hang

illumos/illumos-gate@af868f46a5b794687741d5424de9e3a2d684a84a
https://github.com/illumos/illumos-gate/commit/af868f46a5b794687741d5424de9e3a2d684a84a

https://www.illumos.org/issues/6914

FreeBSD note: only a ZFS part of the change is merged, changes to the VM
subsystem are not ported (obviously).  Also, now that FreeBSD has
vmem(9) we don't have to ifdef-out the code that uses it.

MFC after: 2 weeks

7 years agoarc_init: make code closer to upstream by introducing 'allmem' variable
avg [Fri, 26 May 2017 11:05:56 +0000 (11:05 +0000)]
arc_init: make code closer to upstream by introducing 'allmem' variable

All the differences in calculations are kept.
A comment about arc_max being 1/2 of all memory is fixed to reflect the
actual code that uses 5/8 as a factor.

MFC after: 1 week

7 years agozfs_putpages: assert that sa_bulk_update() must succeed
avg [Fri, 26 May 2017 10:37:55 +0000 (10:37 +0000)]
zfs_putpages: assert that sa_bulk_update() must succeed

Same as the upstream does in r316927.

MFC after: 1 week

7 years agoMFV r316928: 7256 low probability race in zfs_get_data
avg [Fri, 26 May 2017 10:31:05 +0000 (10:31 +0000)]
MFV r316928: 7256 low probability race in zfs_get_data

illumos/illumos-gate@0c94e1af6784c69a1dea25e0e35dd13b2b91e2e5
https://github.com/illumos/illumos-gate/commit/0c94e1af6784c69a1dea25e0e35dd13b2b91e2e5

https://www.illumos.org/issues/7256
                         error = dmu_sync(zio, lr->lr_common.lrc_txg,
                              zfs_get_done, zgd);
                         ASSERT(error || lr->lr_length <= zp->z_blksz);
  It's possible, although extremely rare, that the zfs_get_done() callback is
  executed before dmu_sync() returns.
  In that case the znode's range lock is dropped and the znode is unreferenced.
  Thus, the assertion can access some invalid or wrong data via the zp pointer.
  size variable caches the correct value of z_blksz and can be safely used here.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Andriy Gapon <andriy.gapon@clusterhq.com>

MFC after: 1 week

7 years agoMFC r316924: 8061 sa_find_idx_tab can be declared more type-safely
avg [Fri, 26 May 2017 10:27:35 +0000 (10:27 +0000)]
MFC r316924: 8061 sa_find_idx_tab can be declared more type-safely

illumos/illumos-gate@7f0bdb4257bb4f1f76390b72665961e411da24c6
https://github.com/illumos/illumos-gate/commit/7f0bdb4257bb4f1f76390b72665961e411da24c6

https://www.illumos.org/issues/8061
  sa_find_idx_tab() is declared as taking and returning "void *" parameters.
  These can be declared to be the specific types.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Chris Williamson <chris.williamson@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

MFC after: 1 week

7 years agoDisconnect heimdal version of qsort.c from build because we are already
delphij [Fri, 26 May 2017 06:09:11 +0000 (06:09 +0000)]
Disconnect heimdal version of qsort.c from build because we are already
using libc's version of qsort.

PR: bin/213922
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10814

7 years agobsdgrep: use safer sizeof() construct
emaste [Fri, 26 May 2017 03:35:59 +0000 (03:35 +0000)]
bsdgrep: use safer sizeof() construct

Submitted by: Kyle Evans <kevans91@ksu.edu>

7 years agoSimplify parseval() by allocating a buffer the size of the input string,
araujo [Fri, 26 May 2017 03:27:06 +0000 (03:27 +0000)]
Simplify parseval() by allocating a buffer the size of the input string,
which will always be big enough to hold the output string.

Obtained from: OpenBSD (revision 1.36)

7 years agobsdgrep: correct assumptions to prepare for chunking
emaste [Fri, 26 May 2017 02:30:26 +0000 (02:30 +0000)]
bsdgrep: correct assumptions to prepare for chunking

Correct a couple of minor BSD grep assumptions that are valid for line
processing but not future chunk-based processing.

Submitted by: Kyle Evans <kevans91@ksu.edu>
Reviewed by: bapt, cem
Differential Revision: https://reviews.freebsd.org/D10824

7 years agofts_open: move bogus initialization further below, before it is used.
pfg [Fri, 26 May 2017 01:14:58 +0000 (01:14 +0000)]
fts_open: move bogus initialization further below, before it is used.

Move an unneeded initialization, introduced in r54770 to quiet down GCC,
to a place nearer to its first use. This has no practical effect, it just
keeps the garbage better sorted.

Hinted by: OpenBSD (CVS rev. 1.56, without obfuscations)

7 years agolibc: rm stale generated files which are no longer syscalls
emaste [Fri, 26 May 2017 00:51:05 +0000 (00:51 +0000)]
libc: rm stale generated files which are no longer syscalls

This is an attempt to help -DNO_CLEAN builds after r302092 (which
removed the pipe libc syscall wrapper) and r318736 (which removed
getdents, lstat, mknod, and stat).

Dependencies cannot cope with certain source tree changes,
particularly with respect to removing source files and replacing
generated files.  Handle these cases from _worldtmp in an ad-hoc
fashion.

Reviewed by: bdrewery, cem
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10876

7 years ago[ath] fix short-GI wireshark flag.
adrian [Fri, 26 May 2017 00:48:21 +0000 (00:48 +0000)]
[ath] fix short-GI wireshark flag.

Yes, HAL_RX_GI means "short guard interval."

7 years agobsdgrep: add --mmap tests
emaste [Fri, 26 May 2017 00:19:50 +0000 (00:19 +0000)]
bsdgrep: add --mmap tests

Basic sanity tests as well as coverage for the bug fixed in r318565.

Submitted by: Kyle Evans <kevans91@ksu.edu>
Reviewed by: bapt, ngie
Differential Revision: https://reviews.freebsd.org/D10827

7 years agoRemove some code, dead from the day one.
mav [Thu, 25 May 2017 23:19:09 +0000 (23:19 +0000)]
Remove some code, dead from the day one.

7 years agoPull in r303257 from upstream llvm trunk (by Krzysztof Parzyszek)
dim [Thu, 25 May 2017 23:14:51 +0000 (23:14 +0000)]
Pull in r303257 from upstream llvm trunk (by Krzysztof Parzyszek)

  [PPC] Properly update register save area offsets

  The variables MinGPR/MinG8R were not updated properly when resetting the
  offsets, which in the included testcase lead to saving the CR register
  in the same location as R30.

  This fixes another issue reported in PR26519.

  Differential Revision: https://reviews.llvm.org/D33017

Reported by: Mark Millard
PR: 206990
MFC after: 3 days

7 years agoTry to keep up with the ports system Makefiles.
phk [Thu, 25 May 2017 21:59:19 +0000 (21:59 +0000)]
Try to keep up with the ports system Makefiles.

7 years agomakefs: make buf generic
emaste [Thu, 25 May 2017 21:41:06 +0000 (21:41 +0000)]
makefs: make buf generic

it has nothing to do with ffs and will eventually be moved.
gc sectorsize.

This is a corrected version of r317744.

NetBSD versions:
ffs.c 1.58
ffs/buf.c 1.14 1.18
ffs/buf.h 1.8

Submitted by: Siva Mahadevan <smahadevan@freebsdfoundation.org>
Obtained from: NetBSD
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10803

7 years agoRemove the old man.template
bapt [Thu, 25 May 2017 21:16:39 +0000 (21:16 +0000)]
Remove the old man.template

In FreeBSD we only use mdoc(7) format. A template is available as mdoc.template
The usage of man(7) format is discouraged and this file was driving people into
the front direction as a template to use.

7 years agoupdate to 2017.05.25
bapt [Thu, 25 May 2017 21:11:25 +0000 (21:11 +0000)]
update to 2017.05.25

MFC after: 2 days

7 years agoMerge OpenSSL 1.0.2l.
jkim [Thu, 25 May 2017 20:52:16 +0000 (20:52 +0000)]
Merge OpenSSL 1.0.2l.

7 years ago Import OpenSSL 1.0.2l.
jkim [Thu, 25 May 2017 19:38:38 +0000 (19:38 +0000)]
 Import OpenSSL 1.0.2l.

7 years agoFix several problems with mapping code.
slm [Thu, 25 May 2017 19:20:06 +0000 (19:20 +0000)]
Fix several problems with mapping code.

Reviewed by:    ken, scottl, asomers, ambrisko, mav
Approved by: ken, mav
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D10861

7 years agoFix several problems with mapping code.
slm [Thu, 25 May 2017 19:14:44 +0000 (19:14 +0000)]
Fix several problems with mapping code.

Reviewed by:    ken, scottl, asomers, ambrisko, mav
Approved by: ken, mav
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D10878

7 years agoTurn on support for the Amazon "Elastic Network Adapter" in EC2 AMIs.
cperciva [Thu, 25 May 2017 19:02:54 +0000 (19:02 +0000)]
Turn on support for the Amazon "Elastic Network Adapter" in EC2 AMIs.

X-MFC-after: 318647 + fixes for some lock ordering warnings

7 years agoUpdate the diff3 manpage to reflect the fact the version in freebsd does
bapt [Thu, 25 May 2017 18:46:13 +0000 (18:46 +0000)]
Update the diff3 manpage to reflect the fact the version in freebsd does
not use temporary files nor uses a /usr/libexec/diff3prog

7 years agoFix long standing issue in bsdconfig's keymap selection
dteske [Thu, 25 May 2017 18:16:17 +0000 (18:16 +0000)]
Fix long standing issue in bsdconfig's keymap selection

Since the translation to vt as terminal emulator, the keymaps files
path has changed and this change does not get followed in bsdconfig.
This implicates boot time warnings about a wrong keymap file, what
is very confusing for the new users and for me too, so initialize
the default keymaps search path depending on terminal type.

Differential Revision: https://reviews.freebsd.org/D8734
Submitted by: Oliver Pinter <oliver.pinter@hardenedbsd.org>
Reviewed by: ed, jilles, dteske
MFC after: 3 days
X-MFC-to: stable/11
Sponsored by: HardenedBSD
Signed-off-by: Oliver Pinter <oliver.pinter@hardenedbsd.org>

7 years agoFor now comment tests for arguments which are not in par with GNU diff3 yet
bapt [Thu, 25 May 2017 17:58:01 +0000 (17:58 +0000)]
For now comment tests for arguments which are not in par with GNU diff3 yet

7 years agoRemove the MAX_CHECK macro, it was initially used to test if a file was a
bapt [Thu, 25 May 2017 17:55:40 +0000 (17:55 +0000)]
Remove the MAX_CHECK macro, it was initially used to test if a file was a
text file or not.

The check is not done by diff3 but by diff (the argument -a is directly passed
to diff(1))

7 years agoImport working progress BSD diff3
bapt [Thu, 25 May 2017 17:45:50 +0000 (17:45 +0000)]
Import working progress BSD diff3

import bsd diff3 from OpenBSD.
Differences with OpenBSD:
- lots of warning fixed
- no shell wrapper with diff3 actually living in libexec
- capsicumized

Keep it disconnected as it is not yet good enough to replace GNU diff

The motivation to import it now it to allow other people to jump in and also to
have an open development on it

Obtained from: OpenBSD

7 years agolldb: map TRAP_CAP to a trace trap
emaste [Thu, 25 May 2017 16:41:07 +0000 (16:41 +0000)]
lldb: map TRAP_CAP to a trace trap

In the absense of a more specific handler for TRAP_CAP (generated by
ENOTCAPABLE or ECAPMODE while in capability mode) treat it as a trace
trap.

Example usage (testing the bug in PR219173):

% proccontrol -m trapcap lldb usr.bin/hexdump/obj/hexdump -- -Cv -s 1 /bin/ls
...
(lldb) run
Process 12980 launching
Process 12980 launched: '.../usr.bin/hexdump/obj/hexdump' (x86_64)
Process 12980 stopped
* thread #1, stop reason = trace
    frame #0: 0x0000004b80c65f1a libc.so.7`__sys_lseek + 10
...

In the future we should have LLDB control the trapcap procctl itself
(as it does with ASLR), as well as report a specific stop reason.
This change eliminates an assertion failure from LLDB for now.

7 years agoNow that roff documentation has been disconnected from the build, it is no
bapt [Thu, 25 May 2017 16:31:53 +0000 (16:31 +0000)]
Now that roff documentation has been disconnected from the build, it is no
longer necessary to have groff(1) as a bootstrap tool

7 years agoIn preparation for the removal of the roff toolchain, disconnect the
bapt [Thu, 25 May 2017 14:54:22 +0000 (14:54 +0000)]
In preparation for the removal of the roff toolchain, disconnect the
roff documentation from the build.

Those documents will be added to the doc tree and distributed as PDF from
the documentation website. As they are valuable has history, but do not match
current FreeBSD

Further more, the ascii format we were using to distribute them is not really
accurate for such documents.

more details:
https://lists.freebsd.org/pipermail/freebsd-arch/2017-May/018211.html

7 years agoUnmask legacy interrupts on Marvell PCIE controller
zbb [Thu, 25 May 2017 14:34:21 +0000 (14:34 +0000)]
Unmask legacy interrupts on Marvell PCIE controller

This patch fixes a bug introduced with commit:
r294510  "Remove an extra '!' found by clang 3.8."

'!' was removed without inverting the logic, which
broke PCIe legacy interrupts operation for Marvell
controllers.

Submitted by: Michal Mazur <mkm@semihalf.com>
Obtained from: Semihalf
Sponsored by: Netgate

7 years agoImprove the decoding of the third argument of the socket() call.
tuexen [Thu, 25 May 2017 14:27:54 +0000 (14:27 +0000)]
Improve the decoding of the third argument of the socket() call.

Decoding of the third argument depends on the first one. For doing this,
add a corresponding function to libsysdecode.

Thanks to jhb@ for suggesting this.