]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agogetgr_test: fix -Wunused warnings
Enji Cooper [Sun, 28 May 2017 04:43:02 +0000 (04:43 +0000)]
getgr_test: fix -Wunused warnings

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agogetpw_test: fix -Wunused warnings
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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)
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Eric van Gyzen [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
Eric van Gyzen [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Alan Cox [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.
Pedro F. Giffuni [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
Baptiste Daroussin [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 Schubert [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.
Konstantin Belousov [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.
John Baldwin [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
Alan Cox [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
Baptiste Daroussin [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
Baptiste Daroussin [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
Baptiste Daroussin [Sat, 27 May 2017 13:55:20 +0000 (13:55 +0000)]
Capitalize DHCP

Reported by: danfe

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

7 years agoPartially revert r314948
Baptiste Daroussin [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
Baptiste Daroussin [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
Baptiste Daroussin [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
Baptiste Daroussin [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
Baptiste Daroussin [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
Baptiste Daroussin [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.
Xin LI [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
Ed Maste [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
Navdeep Parhar [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.
Alexander Motin [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
Conrad Meyer [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 Davis [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.
John Baldwin [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.
Alexander Motin [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
Andriy Gapon [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.
David Bright [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
Dimitry Andric [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.
Michael 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
Ed Maste [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)
Eric van Gyzen [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
Eric van Gyzen [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
Eric van Gyzen [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
Eric van Gyzen [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
Eric van Gyzen [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
Ed Maste [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
Andriy Gapon [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 ago8265 Reserve send stream flag for large dnode feature
Andriy Gapon [Fri, 26 May 2017 12:07:47 +0000 (12:07 +0000)]
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>

7 years agoMFV r318942: 8166 zpool scrub thinks it repaired offline device
Andriy Gapon [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 ago8166 zpool scrub thinks it repaired offline device
Andriy Gapon [Fri, 26 May 2017 12:02:51 +0000 (12:02 +0000)]
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 ago7446 zpool create should support efi system partition
Andriy Gapon [Fri, 26 May 2017 12:02:14 +0000 (12:02 +0000)]
7446 zpool create should support efi system partition

illumos/illumos-gate@7855d95b30fd903e3918bad5a29b777e765db821
https://github.com/illumos/illumos-gate/commit/7855d95b30fd903e3918bad5a29b777e765db821

https://www.illumos.org/issues/7446
  Since we support whole-disk configuration for boot pool, we also will need
  whole disk support with UEFI boot and for this, zpool create should create efi-
  system partition.
  I have borrowed the idea from oracle solaris, and introducing zpool create -
  B switch to provide an way to specify that boot partition should be created.
  However, there is still an question, how big should the system partition be.
  For time being, I have set default size 256MB (thats minimum size for FAT32
  with 4k blocks). To support custom size, the set on creation "bootsize"
  property is created and so the custom size can be set as: zpool create B -
  o bootsize=34MB rpool c0t0d0
  After pool is created, the "bootsize" property is read only. When -B switch is
  not used, the bootsize defaults to 0 and is shown in zpool get output with
  value ''. Older zfs/zpool implementations are ignoring this property.
  https://www.illumos.org/rb/r/219/

Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Approved by: Dan McDonald <danmcd@kebe.com>
Author: Toomas Soome <tsoome@me.com>

7 years ago7956 "minimum" is misspelled in zpool manpage
Andriy Gapon [Fri, 26 May 2017 12:00:31 +0000 (12:00 +0000)]
7956 "minimum" is misspelled in zpool manpage

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

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

Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Brad Lewis <blewis@delphix.com>

7 years ago6418 zpool should have a label clearing command
Andriy Gapon [Fri, 26 May 2017 11:59:20 +0000 (11:59 +0000)]
6418 zpool should have a label clearing command

illumos/illumos-gate@6401734d545a04c18f68b448202f9d9a77216bb9
https://github.com/illumos/illumos-gate/commit/6401734d545a04c18f68b448202f9d9a77216bb9

https://www.illumos.org/issues/6418
  An easy, direct means of sanitizing pool vdevs can be helpful for management
  purposes.
  FreeBSD has had a 'zpool labelclear' for some time, see: https://
  svnweb.freebsd.org/base?view=revision&revision=224171
  SpectraBSD has a slightly updated version, which I propose for inclusion.

Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Will Andrews <will@firepipe.net>

Note: the bulk of the change has been already imported, this is a follow
up that imports zpool.1m changes.

7 years ago6781 zpool man page needs updated to remove duplicate entry of "cannot be" where...
Andriy Gapon [Fri, 26 May 2017 11:56:28 +0000 (11:56 +0000)]
6781 zpool man page needs updated to remove duplicate entry of "cannot be" where it discusses cache devices

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

https://www.illumos.org/issues/6781
    cache
    A device used to cache storage pool data. A cache device cannot
    be cannot be configured as a mirror or raidz group. For more
    information, see the "Cache Devices" section.
  needs changed to
    cache
    A device used to cache storage pool data. A cache device cannot
    be configured as a mirror or raidz group. For more
    information, see the "Cache Devices" section.

Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Alexander Pyhalov <apyhalov@gmail.com>

7 years ago2897 "zpool split" documentation missing from manpage
Andriy Gapon [Fri, 26 May 2017 11:55:31 +0000 (11:55 +0000)]
2897 "zpool split" documentation missing from manpage

illumos/illumos-gate@879bece34ee134b2be670393fe9ffe33ce268aa0
https://github.com/illumos/illumos-gate/commit/879bece34ee134b2be670393fe9ffe33ce268aa0

https://www.illumos.org/issues/2897
  Found this option in some Oracle documentation and wanted to check out the
  zpool manpage on it in OI. Unfortunately it seems to be missing from the
  manpage, so I first thought it was unsupported. However, "# zpool split" does
  print the correct usage. Testing with the "-n" switch makes me believe it is
  supported (I don't actually need to split my pool).

Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Author: Steven Burgess <sburgess@datto.com>

7 years ago4465 zpool(1M) is able to offline cache vdevs despite what man page says
Andriy Gapon [Fri, 26 May 2017 11:54:42 +0000 (11:54 +0000)]
4465 zpool(1M) is able to offline cache vdevs despite what man page says
5659 in the manual page for zpool(1M), one misuse of the word 'zpool' to describe a pool

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

https://www.illumos.org/issues/4465
  zpool(1M) is able to offline cache vdevs despite man page saying that it isn't:
         zpool offline [-t] pool device ...
             Takes the specified physical device offline. While the device is
             offline, no attempt is made to read or write to the device.

             This command is not applicable to spares or cache devices.
  altair:root:~# zpool create testoff c9t67d0 cache c9t71d0
  altair:root:~# zpool status testoff
    pool: testoff
   state: ONLINE
    scan: none requested
  config:

          NAME        STATE     READ WRITE CKSUM
          testoff     ONLINE       0     0     0
            c9t67d0   ONLINE       0     0     0
          cache
            c9t71d0   ONLINE       0     0     0

  errors: No known data errors
  altair:root:~# zpool offline testoff c9t71d0
  altair:root:~# zpool status testoff
    pool: testoff
   state: ONLINE
  status: One or more devices has been taken offline by the administrator.
          Sufficient replicas exist for the pool to continue functioning in a
          degraded state.
  action: Online the device using 'zpool online' or replace the device with
          'zpool replace'.
    scan: none requested

https://www.illumos.org/issues/5659
  At https://github.com/illumos/illumos-gate/blob/master/usr/src/man/man1m/
  zpool.1m#L931
       Do not add a disk that is currently configured as a quorum device to
       a zpool.
  – should be:
       Do not add a disk that is currently configured as a quorum device to
       a pool.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

7 years agoMFV r318934: 8070 Add some ZFS comments
Andriy Gapon [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 ago8070 Add some ZFS comments
Andriy Gapon [Fri, 26 May 2017 11:48:29 +0000 (11:48 +0000)]
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>

7 years ago8064 need a static DTrace probe in VN_HOLD
Andriy Gapon [Fri, 26 May 2017 11:39:34 +0000 (11:39 +0000)]
8064 need a static DTrace probe in VN_HOLD

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

https://www.illumos.org/issues/8064
  It's currently nearly impossible to trace what process places a hold on
  a vnode, as the only ways holds are place is via the `VN_HOLD()` and
  `VN_HOLD_CALLER()` macros, which inline the bumping of `v_count`. Adding
  static DTrace probes to these macros would enable tracing of where
  specific vnode references come from.
  For completeness and symmetry, a similar static probe should be added to
  `vn_rele()` and `vn_rele_dnlc()`.

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Sebastien Roy <seb@delphix.com>

7 years agoMFV r318931: 8063 verify that we do not attempt to access inactive txg
Andriy Gapon [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 ago8063 verify that we do not attempt to access inactive txg
Andriy Gapon [Fri, 26 May 2017 11:35:34 +0000 (11:35 +0000)]
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>

7 years agoMFV r318929: 7786 zfs`vdev_online() needs better notification about state changes
Andriy Gapon [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 ago7786 zfs`vdev_online() needs better notification about state changes
Andriy Gapon [Fri, 26 May 2017 11:32:05 +0000 (11:32 +0000)]
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>

7 years agoMFV r318927: 8025 dbuf_read() creates unnecessary zio_root() for bonus buf
Andriy Gapon [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 ago8025 dbuf_read() creates unnecessary zio_root() for bonus buf
Andriy Gapon [Fri, 26 May 2017 11:29:31 +0000 (11:29 +0000)]
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
Andriy Gapon [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
Andriy Gapon [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
Andriy Gapon [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
Andriy Gapon [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
Andriy Gapon [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
Xin LI [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
Ed Maste [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,
Marcelo 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
Ed Maste [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.
Pedro F. Giffuni [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
Ed Maste [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 Chadd [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
Ed Maste [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.
Alexander Motin [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)
Dimitry Andric [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.
Poul-Henning Kamp [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
Ed Maste [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
Baptiste Daroussin [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
Baptiste Daroussin [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.
Jung-uk Kim [Thu, 25 May 2017 20:52:16 +0000 (20:52 +0000)]
Merge OpenSSL 1.0.2l.